1
0
mirror of https://github.com/rancher/os.git synced 2025-07-31 22:47:16 +00:00

migrate to python-3.4

This commit is contained in:
Ivan Mikushin 2015-05-08 10:42:18 +05:00
parent 72b29cc797
commit f2d797d6cc
5 changed files with 13 additions and 10 deletions

2
.gitignore vendored
View File

@ -8,5 +8,5 @@
*.swp
Dockerfile
/tests/integration/MANIFEST
/tests/integration/.venv
/tests/integration/.venv*
/tests/integration/.tox

View File

@ -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')

View File

@ -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

View File

@ -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

View File

@ -1,5 +1,5 @@
[tox]
envlist=flake8, py27
envlist=flake8, py34
[testenv]
deps=-rrequirements.txt