From 6d06a32cc95874a115bb28c8b987b83e71441d80 Mon Sep 17 00:00:00 2001 From: bunkerity Date: Wed, 20 Jul 2022 15:37:29 +0200 Subject: [PATCH] tests - list example_data as root --- examples/autoconf-php/setup-autoconf.sh | 8 ++++---- examples/drupal/setup-docker.sh | 3 ++- tests/AutoconfTest.py | 3 ++- tests/DockerTest.py | 3 ++- tests/Test.py | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/examples/autoconf-php/setup-autoconf.sh b/examples/autoconf-php/setup-autoconf.sh index dae449d1e..e4c9d6921 100755 --- a/examples/autoconf-php/setup-autoconf.sh +++ b/examples/autoconf-php/setup-autoconf.sh @@ -6,8 +6,8 @@ if [ $(id -u) -ne 0 ] ; then fi chown -R 101:101 bw-data -find ./bw-data/ -type f -exec chmod 0644 {} \; -find ./bw-data/ -type d -exec chmod 0755 {} \; +find ./bw-data/ -type f -exec chmod 0640 {} \; +find ./bw-data/ -type d -exec chmod 0750 {} \; chown -R 101:33 ./bw-data/www -find ./bw-data/www -type f -exec chmod 0664 {} \; -find ./bw-data/www -type d -exec chmod 0775 {} \; +find ./bw-data/www -type f -exec chmod 0660 {} \; +find ./bw-data/www -type d -exec chmod 0770 {} \; \ No newline at end of file diff --git a/examples/drupal/setup-docker.sh b/examples/drupal/setup-docker.sh index 556099fb8..69265c914 100755 --- a/examples/drupal/setup-docker.sh +++ b/examples/drupal/setup-docker.sh @@ -6,4 +6,5 @@ if [ $(id -u) -ne 0 ] ; then fi chown -R root:101 bw-data -chmod -R 770 bw-data \ No newline at end of file +find ./bw-data -type f -exec chmod 0660 {} \; +find ./bw-data -type d -exec chmod 0770 {} \; \ No newline at end of file diff --git a/tests/AutoconfTest.py b/tests/AutoconfTest.py index d1ef77b49..cd79c0333 100644 --- a/tests/AutoconfTest.py +++ b/tests/AutoconfTest.py @@ -90,7 +90,8 @@ class AutoconfTest(Test) : if proc.returncode != 0 : raise(Exception("setup-autoconf failed")) if isdir(example_data) : - for cp_dir in listdir(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) diff --git a/tests/DockerTest.py b/tests/DockerTest.py index 841a831c7..81921e8d1 100644 --- a/tests/DockerTest.py +++ b/tests/DockerTest.py @@ -49,7 +49,8 @@ class DockerTest(Test) : if proc.returncode != 0 : raise(Exception("setup-docker failed")) if isdir(example_data) : - for cp_dir in listdir(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) diff --git a/tests/Test.py b/tests/Test.py index 774038646..52e0aeada 100644 --- a/tests/Test.py +++ b/tests/Test.py @@ -18,7 +18,7 @@ class Test(ABC) : self.__kind = kind self.__timeout = timeout self.__tests = tests - log("TEST", "ℹ️", "instiantiated with " + str(len(tests)) + " tests and timeout of " + str(timeout) + "s") + log("TEST", "ℹ️", "instiantiated with " + str(len(tests)) + " tests and timeout of " + str(timeout) + "s for " + self._name) # Class method # called once before running all the different tests for a given integration