diff --git a/main.go b/main.go index 5c7ecc9d..82e6fd9d 100644 --- a/main.go +++ b/main.go @@ -50,8 +50,7 @@ func main() { registerCmd("/sbin/halt", power.Halt) registerCmd("/sbin/shutdown", power.Main) registerCmd("/usr/bin/respawn", respawn.Main) - registerCmd("/usr/sbin/rancherctl", control.Main) // deprecated, use `ros` instead - registerCmd("/usr/sbin/ros", control.Main) + registerCmd("/usr/bin/ros", control.Main) registerCmd("/usr/bin/cloud-init", cloudinit.Main) registerCmd("/usr/sbin/netconf", network.Main) registerCmd("/usr/sbin/wait-for-network", waitfornetwork.Main) diff --git a/os-config.yml b/os-config.yml index 6438db13..22525b1d 100644 --- a/os-config.yml +++ b/os-config.yml @@ -130,8 +130,7 @@ rancher: - /usr/bin/ros:/sbin/halt:ro - /usr/bin/ros:/sbin/shutdown:ro - /usr/bin/ros:/usr/bin/respawn:ro - - /usr/bin/ros:/usr/sbin/rancherctl:ro - - /usr/bin/ros:/usr/sbin/ros:ro + - /usr/bin/ros:/usr/bin/ros:ro - /usr/bin/ros:/usr/bin/cloud-init:ro - /usr/bin/ros:/usr/sbin/netconf:ro - /usr/bin/ros:/usr/sbin/wait-for-network:ro diff --git a/tests/integration/rancherostest/__init__.py b/tests/integration/rostest/__init__.py similarity index 100% rename from tests/integration/rancherostest/__init__.py rename to tests/integration/rostest/__init__.py diff --git a/tests/integration/rancherostest/conftest.py b/tests/integration/rostest/conftest.py similarity index 100% rename from tests/integration/rancherostest/conftest.py rename to tests/integration/rostest/conftest.py diff --git a/tests/integration/rancherostest/test_00_system.py b/tests/integration/rostest/test_00_system.py similarity index 97% rename from tests/integration/rancherostest/test_00_system.py rename to tests/integration/rostest/test_00_system.py index 5d32e612..cc2edf53 100644 --- a/tests/integration/rancherostest/test_00_system.py +++ b/tests/integration/rostest/test_00_system.py @@ -2,7 +2,7 @@ from __future__ import print_function import itertools as it import pytest import subprocess -import rancherostest.util as u +import rostest.util as u @pytest.fixture(scope="module") diff --git a/tests/integration/rancherostest/test_01_cloud_config.py b/tests/integration/rostest/test_01_cloud_config.py similarity index 86% rename from tests/integration/rancherostest/test_01_cloud_config.py rename to tests/integration/rostest/test_01_cloud_config.py index 234b519c..4216a4ea 100644 --- a/tests/integration/rancherostest/test_01_cloud_config.py +++ b/tests/integration/rostest/test_01_cloud_config.py @@ -1,5 +1,5 @@ import pytest -import rancherostest.util as u +import rostest.util as u import string import subprocess import yaml @@ -33,7 +33,7 @@ def test_rancher_environment(qemu, cloud_config): u.wait_for_ssh(ssh_command) v = subprocess.check_output( - ssh_command + ['sudo', 'rancherctl', 'env', 'printenv', 'FLANNEL_NETWORK'], + ssh_command + ['sudo', 'ros', 'env', 'printenv', 'FLANNEL_NETWORK'], stderr=subprocess.STDOUT, universal_newlines=True) assert v.strip() == cloud_config['rancher']['environment']['FLANNEL_NETWORK'] @@ -53,6 +53,18 @@ def test_docker_args(qemu, cloud_config): assert v.find(expected) != -1 +@pytest.mark.timeout(40) +def test_dhcpcd(qemu, cloud_config): + assert qemu is not None + u.wait_for_ssh(ssh_command) + + v = subprocess.check_output( + ssh_command + ['sh', '-c', 'ps -ef | grep dhcpcd'], + stderr=subprocess.STDOUT, universal_newlines=True) + + assert v.find('dhcpcd -M') != -1 + + @pytest.mark.timeout(40) def test_docker_tls_args(qemu, cloud_config): assert qemu is not None diff --git a/tests/integration/rancherostest/test_02_custom_kernel.py b/tests/integration/rostest/test_02_custom_kernel.py similarity index 97% rename from tests/integration/rancherostest/test_02_custom_kernel.py rename to tests/integration/rostest/test_02_custom_kernel.py index 817064f0..1a61f582 100644 --- a/tests/integration/rancherostest/test_02_custom_kernel.py +++ b/tests/integration/rostest/test_02_custom_kernel.py @@ -2,7 +2,7 @@ from __future__ import print_function import itertools as it import pytest import subprocess -import rancherostest.util as u +import rostest.util as u @pytest.fixture(scope="module") diff --git a/tests/integration/rancherostest/test_03_docker_in_persistent_console.py b/tests/integration/rostest/test_03_docker_in_persistent_console.py similarity index 96% rename from tests/integration/rancherostest/test_03_docker_in_persistent_console.py rename to tests/integration/rostest/test_03_docker_in_persistent_console.py index c91d4940..5243a9ca 100644 --- a/tests/integration/rancherostest/test_03_docker_in_persistent_console.py +++ b/tests/integration/rostest/test_03_docker_in_persistent_console.py @@ -1,5 +1,5 @@ import pytest -import rancherostest.util as u +import rostest.util as u import subprocess diff --git a/tests/integration/rancherostest/test_04_ros_install.py b/tests/integration/rostest/test_04_ros_install.py similarity index 94% rename from tests/integration/rancherostest/test_04_ros_install.py rename to tests/integration/rostest/test_04_ros_install.py index 21272260..a79280ba 100644 --- a/tests/integration/rancherostest/test_04_ros_install.py +++ b/tests/integration/rostest/test_04_ros_install.py @@ -1,5 +1,5 @@ import pytest -import rancherostest.util as u +import rostest.util as u import subprocess @@ -19,7 +19,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.0-dev-test.135'], + '-i', 'rancher/os:v0.4.1'], stderr=subprocess.STDOUT, universal_newlines=True) subprocess.call(ssh_command + ['sudo', 'reboot'], diff --git a/tests/integration/rancherostest/test_05_custom_docker_in_persistent_console.py b/tests/integration/rostest/test_05_custom_docker_in_persistent_console.py similarity index 84% rename from tests/integration/rancherostest/test_05_custom_docker_in_persistent_console.py rename to tests/integration/rostest/test_05_custom_docker_in_persistent_console.py index fcd98332..a5575110 100644 --- a/tests/integration/rancherostest/test_05_custom_docker_in_persistent_console.py +++ b/tests/integration/rostest/test_05_custom_docker_in_persistent_console.py @@ -1,5 +1,5 @@ import pytest -import rancherostest.util as u +import rostest.util as u import subprocess @@ -17,13 +17,13 @@ def test_system_docker_survives_custom_docker_install(qemu): assert qemu is not None u.wait_for_ssh(ssh_command) subprocess.check_call(ssh_command + ['curl', '-OL', - 'https://get.docker.com/builds/Linux/x86_64/docker-1.9.0'], + 'https://experimental.docker.com/builds/Linux/x86_64/docker-1.10.0-dev'], stderr=subprocess.STDOUT, universal_newlines=True) - subprocess.check_call(ssh_command + ['chmod', '+x', '/home/rancher/docker-1.9.0'], + subprocess.check_call(ssh_command + ['chmod', '+x', '/home/rancher/docker-1.10.0-dev'], stderr=subprocess.STDOUT, universal_newlines=True) - subprocess.check_call(ssh_command + ['sudo', 'ln', '-sf', '/home/rancher/docker-1.9.0', '/usr/bin/docker'], + subprocess.check_call(ssh_command + ['sudo', 'ln', '-sf', '/home/rancher/docker-1.10.0-dev', '/usr/bin/docker'], stderr=subprocess.STDOUT, universal_newlines=True) subprocess.check_call(ssh_command + ['sudo', 'system-docker', 'restart', 'docker'], diff --git a/tests/integration/rancherostest/test_sample.py b/tests/integration/rostest/test_sample.py similarity index 100% rename from tests/integration/rancherostest/test_sample.py rename to tests/integration/rostest/test_sample.py diff --git a/tests/integration/rancherostest/util.py b/tests/integration/rostest/util.py similarity index 100% rename from tests/integration/rancherostest/util.py rename to tests/integration/rostest/util.py diff --git a/tests/integration/setup.py b/tests/integration/setup.py index fba2685f..2d48f65b 100644 --- a/tests/integration/setup.py +++ b/tests/integration/setup.py @@ -4,7 +4,7 @@ setup( name='RancherOSIntegrationTests', version='0.1', packages=[ - 'rancherostest' + 'rostest' ], license='ASL 2.0', long_description=open('README.txt').read(), diff --git a/tests/integration/tox.ini b/tests/integration/tox.ini index 28f44931..e16eedf0 100644 --- a/tests/integration/tox.ini +++ b/tests/integration/tox.ini @@ -4,11 +4,11 @@ skipsdist=True [testenv] deps=-rrequirements.txt -commands=py.test -s --durations=20 rancherostest {posargs} +commands=py.test -s --durations=20 rostest {posargs} [testenv:flake8] deps=flake8 -commands=flake8 rancherostest +commands=flake8 rostest [flake8] max-line-length = 120