mirror of
https://github.com/rancher/os.git
synced 2025-09-05 00:37:12 +00:00
make tests run on arm64
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
import pytest
|
||||
import rostest.util as u
|
||||
from rostest.util import SSH
|
||||
|
||||
ssh_command = ['./scripts/ssh', '--qemu', '--key', './tests/integration/assets/test.key']
|
||||
cloud_config_path = './tests/integration/assets/test_03/cloud-config.yml'
|
||||
@@ -19,15 +20,19 @@ nginx = {'amd64': 'nginx', 'arm': 'armhfbuild/nginx', 'arm64': 'armhfbuild/nginx
|
||||
|
||||
@pytest.mark.timeout(40)
|
||||
def test_reboot_with_container_running(qemu):
|
||||
u.wait_for_ssh(qemu, ssh_command)
|
||||
subprocess.check_call(ssh_command + ['docker', 'run', '-d', '--restart=always', nginx[u.arch]],
|
||||
stderr=subprocess.STDOUT, universal_newlines=True)
|
||||
try:
|
||||
SSH(qemu, ssh_command).check_call('''
|
||||
set -ex
|
||||
docker run -d --restart=always %(image)s
|
||||
sudo reboot
|
||||
'''.strip() % {'image': nginx[u.arch]})
|
||||
except:
|
||||
pass
|
||||
|
||||
subprocess.call(ssh_command + ['sudo', 'reboot'],
|
||||
stderr=subprocess.STDOUT, universal_newlines=True)
|
||||
time.sleep(3)
|
||||
|
||||
u.wait_for_ssh(qemu, ssh_command)
|
||||
v = subprocess.check_output(ssh_command + ['docker', 'ps', '-f', 'status=running'],
|
||||
stderr=subprocess.STDOUT, universal_newlines=True)
|
||||
v = SSH(qemu, ssh_command).check_output('''
|
||||
docker ps -f status=running
|
||||
'''.strip())
|
||||
|
||||
assert v.find('nginx') != -1
|
||||
|
Reference in New Issue
Block a user