Skip to content
Snippets Groups Projects
Commit 4d8bc2d9 authored by MJB's avatar MJB
Browse files

moved rspec tests to the actual test directories streaming and streaming-sim

parent 86663f59
No related branches found
No related tags found
No related merge requests found
import pytest
import yaml
@pytest.fixture(scope="module")
def streaming_sim_config():
"""Returns the service configuration deployed for the streaming simulation test. In future this needs to be a parameterised fixture shared with other rspec.yml based tests"""
with open("test/streaming-sim/rspec.yml", 'r') as stream:
data_loaded = yaml.load(stream)
return data_loaded
\ No newline at end of file
import pytest
import os
def test_service_names(streaming_sim_config):
print(streaming_sim_config['hosts'][0]['name'])
assert streaming_sim_config['hosts'][0]['name'] == 'clmc-service'
assert streaming_sim_config['hosts'][1]['name'] == 'ipendpoint1'
assert streaming_sim_config['hosts'][2]['name'] == 'ipendpoint2'
def test_ping(streaming_sim_config):
"""This test will only run on linux due to using os.system library"""
for x in streaming_sim_config['hosts']:
print(x['ip_address'])
response = os.system("ping -c 1 " + x['ip_address'])
assert response == 0
import pytest
import yaml
@pytest.fixture(scope="module")
def streaming_config():
"""Returns the service configuration deployed for the streaming test. In future this needs to be a parameterised fixture shared with other rspec.yml based tests"""
with open("test/streaming/rspec.yml", 'r') as stream:
data_loaded = yaml.load(stream)
return data_loaded
\ No newline at end of file
import pytest
import os
def test_service_names(streaming_config):
print(streaming_config['hosts'][0]['name'])
assert streaming_config['hosts'][0]['name'] == 'clmc-service'
assert streaming_config['hosts'][1]['name'] == 'nginx1'
assert streaming_config['hosts'][2]['name'] == 'nginx2'
assert streaming_config['hosts'][3]['name'] == 'loadtest-streaming'
def test_ping(streaming_config):
"""This test will only run on linux"""
for x in streaming_config['hosts']:
print(x['ip_address'])
response = os.system("ping -c 1 " + x['ip_address'])
assert response == 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment