diff --git a/tests/integration/rostest/test_00_system.py b/tests/integration/rostest/test_00_system.py index 690370a6..23cefb1f 100644 --- a/tests/integration/rostest/test_00_system.py +++ b/tests/integration/rostest/test_00_system.py @@ -18,12 +18,15 @@ def test_system_boot(qemu): u.flush_out(qemu.stdout, 'RancherOS {v} started'.format(v=version)) +busybox = {'amd64': 'busybox', 'arm': 'armhf/busybox', 'arm64': 'aarch64/busybox'} + + @pytest.mark.timeout(60) def test_run_system_container(qemu): u.wait_for_ssh(qemu) ssh = subprocess.Popen( - './scripts/ssh --qemu sudo system-docker run --rm busybox /bin/true', + './scripts/ssh --qemu sudo system-docker run --rm ' + busybox[u.arch] + ' /bin/true', shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True) for ln in u.iter_lines(ssh.stdout): diff --git a/tests/integration/rostest/test_01_cloud_config.py b/tests/integration/rostest/test_01_cloud_config.py index 60ce2aa5..18fc5ed3 100644 --- a/tests/integration/rostest/test_01_cloud_config.py +++ b/tests/integration/rostest/test_01_cloud_config.py @@ -10,10 +10,14 @@ ssh_command = ['./scripts/ssh', '--qemu', '--key', './tests/integration/assets/t cloud_config_path = './tests/integration/assets/test_01/cloud-config.yml' +net_args = {'amd64': ['-net', 'nic,vlan=1,model=virtio', '-net', 'user,vlan=1,net=10.10.2.0/24'], + 'arm64': ['-netdev', 'user,id=net1,net=10.10.2.0/24', '-device', 'virtio-net-device,netdev=net1']} +net_args['arm'] = net_args['arm64'] + + @pytest.fixture(scope="module") def qemu(request): - q = u.run_qemu(request, ['--cloud-config', cloud_config_path, - '-net', 'nic,vlan=1,model=virtio', '-net', 'user,vlan=1,net=10.10.2.0/24']) + q = u.run_qemu(request, ['--cloud-config', cloud_config_path] + net_args[u.arch]) u.flush_out(q.stdout) return q diff --git a/tests/integration/rostest/test_03_docker_in_persistent_console.py b/tests/integration/rostest/test_03_docker_in_persistent_console.py index 47b03fb1..49326a0c 100644 --- a/tests/integration/rostest/test_03_docker_in_persistent_console.py +++ b/tests/integration/rostest/test_03_docker_in_persistent_console.py @@ -14,10 +14,13 @@ def qemu(request): return q +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'], + subprocess.check_call(ssh_command + ['docker', 'run', '-d', '--restart=always', nginx[u.arch]], stderr=subprocess.STDOUT, universal_newlines=True) subprocess.call(ssh_command + ['sudo', 'reboot'], diff --git a/tests/integration/rostest/test_04_ros_install.py b/tests/integration/rostest/test_04_ros_install.py index 69e71da0..65b2a938 100644 --- a/tests/integration/rostest/test_04_ros_install.py +++ b/tests/integration/rostest/test_04_ros_install.py @@ -20,7 +20,7 @@ def test_ros_install_on_formatted_disk(qemu): stderr=subprocess.STDOUT, universal_newlines=True) subprocess.check_call(ssh_command + ['sudo', 'ros', 'install', '-f', '--no-reboot', '-d', '/dev/vda', - '-i', 'rancher/os:v0.4.1'], + '-i', 'rancher/os:v0.4.4-dev' + u.suffix], stderr=subprocess.STDOUT, universal_newlines=True) subprocess.call(ssh_command + ['sudo', 'reboot'], diff --git a/tests/integration/rostest/test_05_custom_docker_in_persistent_console.py b/tests/integration/rostest/test_05_custom_docker_in_persistent_console.py index 42f90ea3..dd906433 100644 --- a/tests/integration/rostest/test_05_custom_docker_in_persistent_console.py +++ b/tests/integration/rostest/test_05_custom_docker_in_persistent_console.py @@ -13,18 +13,21 @@ def qemu(request): u.flush_out(q.stdout) return q +docker_url = {'amd64': 'https://experimental.docker.com/builds/Linux/x86_64/docker-1.10.0-dev', + 'arm': 'https://github.com/rancher/docker/releases/download/v1.10.3-arm/docker-1.10.3_arm', + 'arm64': 'https://github.com/rancher/docker/releases/download/v1.10.3-arm/docker-1.10.3_arm64'} + @pytest.mark.timeout(40) def test_system_docker_survives_custom_docker_install(qemu): u.wait_for_ssh(qemu, ssh_command) - subprocess.check_call(ssh_command + ['curl', '-OL', - 'https://experimental.docker.com/builds/Linux/x86_64/docker-1.10.0-dev'], + subprocess.check_call(ssh_command + ['curl', '-Lfo', './docker', docker_url[u.arch]], stderr=subprocess.STDOUT, universal_newlines=True) - subprocess.check_call(ssh_command + ['chmod', '+x', '/home/rancher/docker-1.10.0-dev'], + subprocess.check_call(ssh_command + ['chmod', '+x', '/home/rancher/docker'], stderr=subprocess.STDOUT, universal_newlines=True) - subprocess.check_call(ssh_command + ['sudo', 'ln', '-sf', '/home/rancher/docker-1.10.0-dev', '/usr/bin/docker'], + subprocess.check_call(ssh_command + ['sudo', 'ln', '-sf', '/home/rancher/docker', '/usr/bin/docker'], stderr=subprocess.STDOUT, universal_newlines=True) subprocess.check_call(ssh_command + ['sudo', 'system-docker', 'restart', 'docker'], diff --git a/tests/integration/rostest/test_sample.py b/tests/integration/rostest/test_sample.py deleted file mode 100644 index 1030a2e3..00000000 --- a/tests/integration/rostest/test_sample.py +++ /dev/null @@ -1,6 +0,0 @@ -def func(x): - return x + 1 - - -def test_answer(): - assert func(3) == 4 diff --git a/tests/integration/rostest/util.py b/tests/integration/rostest/util.py index 0ef01eed..acfa2718 100644 --- a/tests/integration/rostest/util.py +++ b/tests/integration/rostest/util.py @@ -1,12 +1,18 @@ from __future__ import print_function import itertools as it +import os import subprocess import time import pytest ros_test = 'ros-test' +arch = os.environ['ARCH'] + +suffix = '' +if arch != 'amd64': + suffix = '_' + arch def iter_lines(s):