tests - add cleanup for linux tests
This commit is contained in:
parent
17b6b0fdc8
commit
b5c07dda01
|
@ -9,4 +9,3 @@ chown -R www-data:nginx ./bw-data/www
|
|||
find ./bw-data/www -type f -exec chmod 0640 {} \;
|
||||
find ./bw-data/www -type d -exec chmod 0750 {} \;
|
||||
cp -rp ./bw-data/www/* /opt/bunkerweb/www
|
||||
cp variables.env /opt/bunkerweb/variables.env
|
||||
|
|
|
@ -118,6 +118,17 @@ class LinuxTest(Test) :
|
|||
return False
|
||||
return True
|
||||
|
||||
def _cleanup_test(self) :
|
||||
try :
|
||||
proc = LinuxTest.docker_exec(self.__distro, "rm -rf /opt/bunkerweb/www/* ; rm -rf /opt/bunkerweb/confs/* ; rm -rf /opt/bunkerweb/plugins/*")
|
||||
if proc.returncode != 0 :
|
||||
raise(Exception("docker exec rm failed (cleanup)"))
|
||||
super()._cleanup_test()
|
||||
except :
|
||||
log("DOCKER", "❌", "exception while running DockerTest._cleanup_test()\n" + format_exc())
|
||||
return False
|
||||
return True
|
||||
|
||||
def _debug_fail(self) :
|
||||
LinuxTest.docker_exec(self.__distro, "cat /var/log/nginx/access.log ; cat /var/log/nginx/error.log ; journalctl -u bunkerweb --no-pager")
|
||||
|
||||
|
|
Loading…
Reference in New Issue