diff --git a/.gitignore b/.gitignore index 766527ca..f5581224 100644 --- a/.gitignore +++ b/.gitignore @@ -8,5 +8,5 @@ *.swp Dockerfile /tests/integration/MANIFEST -/tests/integration/.venv +/tests/integration/.venv* /tests/integration/.tox diff --git a/tests/integration/rancherostest/conftest.py b/tests/integration/rancherostest/conftest.py index df90dba5..1dc9c92e 100644 --- a/tests/integration/rancherostest/conftest.py +++ b/tests/integration/rancherostest/conftest.py @@ -3,6 +3,6 @@ import pytest @pytest.fixture(scope="session", autouse=True) -def my_own_session_run_at_beginning(): +def chdir_to_project_root(): os.chdir('../..') print('\nChdir to project root dir') diff --git a/tests/integration/rancherostest/test_system.py b/tests/integration/rancherostest/test_system.py index 983dc7d7..42c96d0d 100644 --- a/tests/integration/rancherostest/test_system.py +++ b/tests/integration/rancherostest/test_system.py @@ -1,12 +1,11 @@ import pytest -import string import subprocess import time @pytest.fixture(scope="module") def qemu(request): - p = subprocess.Popen('./scripts/run', stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + p = subprocess.Popen('./scripts/run', stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True) def fin(): print('\nTerminating QEMU') @@ -20,8 +19,8 @@ def qemu(request): @pytest.mark.timeout(20) def test_system_boot(qemu): for ln in iter(qemu.stdout.readline, ''): - ros_booted_substr = string.find(ln, 'RancherOS v0.3.1-rc2 started') - print(string.strip(ln)) + ros_booted_substr = str.find(ln, 'RancherOS v0.3.1-rc2 started') # TODO use ./scripts/version + print(str.strip(ln)) if ros_booted_substr > -1: assert True return @@ -31,14 +30,14 @@ def test_system_boot(qemu): @pytest.mark.timeout(40) def test_run_system_container(qemu): assert qemu.returncode is None - time.sleep(1) # or else ssh will fail (WTF?!) + time.sleep(2) # or else ssh will fail (WTF?!) ssh = subprocess.Popen( './scripts/ssh sudo system-docker run --rm busybox /bin/true', shell=True, - stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True) try: for ln in iter(ssh.stdout.readline, ''): - print(string.strip(ln)) + print(str.strip(ln)) pass ssh.wait() assert ssh.returncode == 0 diff --git a/tests/integration/requirements.txt b/tests/integration/requirements.txt index ed3efe02..4dd47293 100644 --- a/tests/integration/requirements.txt +++ b/tests/integration/requirements.txt @@ -1,4 +1,8 @@ flake8==2.4.0 +mccabe==0.3 +pep8==1.6.2 +py==1.4.27 +pyflakes==0.8.1 pytest==2.7.0 pytest-timeout==0.4 tox==1.9.2 diff --git a/tests/integration/tox.ini b/tests/integration/tox.ini index 3ec7cf0e..20c60287 100644 --- a/tests/integration/tox.ini +++ b/tests/integration/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist=flake8, py27 +envlist=flake8, py34 [testenv] deps=-rrequirements.txt