Skip to content

Commit

Permalink
test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
fmirus committed Oct 10, 2024
1 parent 4978206 commit 565cfe1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
16 changes: 8 additions & 8 deletions test/scenario_execution_docker_test/test/test_docker_copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ def test_success(self):
scenario test_success:
timeout(10)
do parallel:
docker_run(image: 'ubuntu', command: 'sleep 5', detach: true, container_name: 'sleeping_beauty', remove: true)
docker_run(image: 'ubuntu', command: 'sleep 5', detach: true, container_name: 'sleeping_beauty_copy_success', remove: true)
serial:
docker_exec(container: 'sleeping_beauty', command: 'mkdir -p /tmp/test_dir/')
docker_exec(container: 'sleeping_beauty', command: 'touch /tmp/test_dir/test.txt')
docker_exec(container: 'sleeping_beauty', command: 'touch /tmp/test_dir/test_1.txt')
docker_copy(container: 'sleeping_beauty', file_path: '/tmp/test_dir/')
docker_exec(container: 'sleeping_beauty_copy_success', command: 'mkdir -p /tmp/test_dir/')
docker_exec(container: 'sleeping_beauty_copy_success', command: 'touch /tmp/test_dir/test.txt')
docker_exec(container: 'sleeping_beauty_copy_success', command: 'touch /tmp/test_dir/test_1.txt')
docker_copy(container: 'sleeping_beauty_copy_success', file_path: '/tmp/test_dir/')
check_file_exists(file_name: '""" + self.tmp_dir.name + '/test_dir/test.txt' + """')
check_file_exists(file_name: '""" + self.tmp_dir.name + '/test_dir/test_1.txt' + """')
emit end
Expand All @@ -72,12 +72,12 @@ def test_failure_missing_file(self):
import osc.docker
import osc.helpers
scenario test_success:
scenario test_fail:
timeout(10s)
do parallel:
docker_run(image: 'ubuntu', command: 'sleep 5', detach: true, container_name: 'sleeping_beauty1', remove: true)
docker_run(image: 'ubuntu', command: 'sleep 5', detach: true, container_name: 'sleeping_beauty_copy_fail', remove: true)
serial:
docker_copy(container: 'sleeping_beauty1', file_path: '/tmp/test_dir/')
docker_copy(container: 'sleeping_beauty_copy_fail', file_path: '/tmp/test_dir/')
""")
self.assertFalse(self.scenario_execution.process_results())

10 changes: 5 additions & 5 deletions test/scenario_execution_docker_test/test/test_docker_exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ def test_success(self):
scenario test_success:
timeout(30s)
do parallel:
docker_run(image: 'ubuntu', command: 'sleep 10', detach: true, container_name: 'sleeping_beauty', remove: true)
docker_run(image: 'ubuntu', command: 'sleep 10', detach: true, container_name: 'sleeping_beauty_exec_success', remove: true)
serial:
docker_exec(container: 'sleeping_beauty', command: 'echo hello world')
docker_exec(container: 'sleeping_beauty_exec_success', command: 'echo hello world')
emit end
""")
self.assertTrue(self.scenario_execution.process_results())
Expand All @@ -65,9 +65,9 @@ def test_failure(self):
scenario test_failure:
timeout(15s)
do parallel:
docker_run(image: 'ubuntu', command: 'sleep 10', detach: true, container_name: 'sleeping_beauty1', remove: true)
docker_run(image: 'ubuntu', command: 'sleep 10', detach: true, container_name: 'sleeping_beauty_exec_fail', remove: true)
serial:
docker_exec(container: 'sleeping_beauty1', command: 'ls UKNOWN_DIR')
docker_exec(container: 'sleeping_beauty_exec_fail', command: 'ls UKNOWN_DIR')
""")
self.assertFalse(self.scenario_execution.process_results())

Expand All @@ -79,7 +79,7 @@ def test_failure_container_not_running(self):
scenario test_failure_container_not_running:
timeout(3s)
do serial:
docker_exec(container: 'sleeping_beauty2', command: 'echo hello world')
docker_exec(container: 'sleeping_beauty', command: 'echo hello world')
""")
self.assertFalse(self.scenario_execution.process_results())

10 changes: 5 additions & 5 deletions test/scenario_execution_docker_test/test/test_docker_put.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ def test_success(self):
scenario test_success:
timeout(10s)
do parallel:
docker_run(image: 'ubuntu', command: 'sleep 5', detach: true, container_name: 'sleeping_beauty', remove: true)
docker_run(image: 'ubuntu', command: 'sleep 5', detach: true, container_name: 'sleeping_beauty_put', remove: true)
serial:
docker_put(container: 'sleeping_beauty', source_path: '""" + self.tmp_file.name + """', target_path: '/tmp/')
docker_exec(container: 'sleeping_beauty', command: 'test -f """ + self.tmp_file.name + """')
docker_put(container: 'sleeping_beauty_put', source_path: '""" + self.tmp_file.name + """', target_path: '/tmp/')
docker_exec(container: 'sleeping_beauty_put', command: 'test -f """ + self.tmp_file.name + """')
emit end
""")
self.assertTrue(self.scenario_execution.process_results())
Expand All @@ -66,9 +66,9 @@ def test_failure_missing_file(self):
scenario test_failure_unknown_file:
timeout(10s)
do parallel:
docker_run(image: 'ubuntu', command: 'sleep 5', detach: true, container_name: 'sleeping_beauty1', remove: true)
docker_run(image: 'ubuntu', command: 'sleep 5', detach: true, container_name: 'sleeping_beauty_put_fail', remove: true)
serial:
docker_put(container: 'sleeping_beauty1', source_path: 'UNKNOWN', target_path: '/tmp/')
docker_put(container: 'sleeping_beauty_put_fail', source_path: 'UNKNOWN', target_path: '/tmp/')
""")
self.assertFalse(self.scenario_execution.process_results())

4 changes: 2 additions & 2 deletions test/scenario_execution_docker_test/test/test_docker_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ def test_success_volume_mount(self):
scenario test:
timeout(10s)
do parallel:
docker_run(image: 'ubuntu', command: 'sleep 5', detach: true, volumes: ['""" + self.tmp_dir.name + """:/data'], container_name: 'sleeping_beauty')
docker_run(image: 'ubuntu', command: 'sleep 5', detach: true, volumes: ['""" + self.tmp_dir.name + """:/data'], container_name: 'sleeping_beauty_run_volume')
serial:
docker_exec(container: 'sleeping_beauty', command: 'ls /data')
docker_exec(container: 'sleeping_beauty_run_volume', command: 'ls /data')
emit end
""")
self.assertTrue(self.scenario_execution.process_results())
Expand Down

0 comments on commit 565cfe1

Please sign in to comment.