CI: Test old packages with Docker
@@ -785,15 +785,18 @@ def functional_tests(raise_warnings, interactive, run_vagrant, run_docker):
old_packages = [
('simple-0.4.0.rpz',
'https://drive.google.com/uc?export=download&id=0B3ucPz7GSthBVG4xZW1V'
- 'eDhXNTQ'),
+ 'eDhXNTQ',
+ 'arg_2'),
('simple-0.6.0.rpz',
'https://drive.google.com/uc?export=download&id=0B3ucPz7GSthBbl9SUjhr'
- 'cUdtbGs'),
+ 'cUdtbGs',
+ 'arg_2'),
('simple-0.7.1.rpz',
'https://drive.google.com/uc?export=download&id=0B3ucPz7GSthBRGp2Vm5V'
- 'QVpWOGs'),
+ 'QVpWOGs',
+ 'arg2'),
]
- for name, url in old_packages:
+ for name, url, outputname in old_packages:
print("Testing old package %s" % name)
f = Path(name)
if not f.exists():
@@ -804,6 +807,7 @@ def functional_tests(raise_warnings, interactive, run_vagrant, run_docker):
check_call(rpuz + ['showfiles', name])
# Lists packages
check_call(rpuz + ['installpkgs', '--summary', name])
+ if not run_docker:
# Unpack directory
check_call(rpuz + ['directory', 'setup', name, 'simpledir'])
# Run directory
@@ -813,18 +817,20 @@ def functional_tests(raise_warnings, interactive, run_vagrant, run_docker):
output_in_dir = output_in_dir / 'simple_output.txt'
with output_in_dir.open(encoding='utf-8') as fp:
assert fp.read().strip() == '42'
- # Delete with wrong command (should fail)
- p = subprocess.Popen(rpuz + ['chroot', 'destroy', 'simpledir'],
- stderr=subprocess.PIPE)
- out, err = p.communicate()
- assert p.poll() != 0
- err = err.splitlines()
- while b"DeprecationWarning" in err[0] or b"ImportWarning" in err[0]:
- err = err[2:]
- assert b"Wrong unpacker used" in err[0]
- assert err[1].startswith(b"usage: ")
# Delete directory
check_call(rpuz + ['directory', 'destroy', 'simpledir'])
+ else:
+ # Unpack docker
+ check_call(rpuz + ['docker', 'setup', name, 'simpledocker'])
+ # Run docker
+ check_simple(rpuz + ['docker', 'run', 'simpledocker'], 'out')
+ # Get output file
+ check_call(rpuz + ['docker', 'download', 'simpledocker',
+ outputname + ':doutput1.txt'])
+ with Path('doutput1.txt').open(encoding='utf-8') as fp:
+ assert fp.read().strip() == '42'
+ # Delete docker
+ check_call(rpuz + ['docker', 'destroy', 'simpledocker'])
# ########################################
# Copies back coverage report
