tests - replace python cp with sudo cp

This commit is contained in:
bunkerity 2022-07-20 16:01:14 +02:00
parent 6d06a32cc9
commit a607bd67cb
No known key found for this signature in database
GPG Key ID: 3D80806F12602A7C
2 changed files with 6 additions and 12 deletions

View File

@ -90,12 +90,9 @@ class AutoconfTest(Test) :
if proc.returncode != 0 :
raise(Exception("setup-autoconf failed"))
if isdir(example_data) :
proc = run("sudo ls " + example_data, shell=True, capture_output=True)
for cp_dir in proc.stdout.decode().splitlines() :
if isdir(join(example_data, cp_dir)) :
if isdir(join("/tmp/bw-data", cp_dir)) :
run("sudo rm -rf " + join("/tmp/bw-data", cp_dir), shell=True)
copytree(join(example_data, cp_dir), join("/tmp/bw-data", cp_dir))
proc = run("sudo cp -rp " + example_data + "/* /tmp/bw-data", shell=True)
if proc.returncode != 0 :
raise(Exception("cp bw-data failed"))
proc = run("docker-compose -f autoconf.yml pull", shell=True, cwd=test)
if proc.returncode != 0 :
raise(Exception("docker-compose pull failed"))

View File

@ -49,12 +49,9 @@ class DockerTest(Test) :
if proc.returncode != 0 :
raise(Exception("setup-docker failed"))
if isdir(example_data) :
proc = run("sudo ls " + example_data, shell=True, capture_output=True)
for cp_dir in proc.stdout.decode().splitlines() :
if isdir(join(example_data, cp_dir)) :
if isdir(join("/tmp/bw-data", cp_dir)) :
run("sudo rm -rf " + join("/tmp/bw-data", cp_dir), shell=True)
copytree(join(example_data, cp_dir), join("/tmp/bw-data", cp_dir))
proc = run("sudo cp -rp " + example_data + "/* /tmp/bw-data", shell=True)
if proc.returncode != 0 :
raise(Exception("cp bw-data failed"))
proc = run("docker-compose pull", shell=True, cwd=test)
if proc.returncode != 0 :
raise(Exception("docker-compose pull failed"))