Report /home/$app as a bad location for app data

This commit is contained in:
Alexandre Aubin 2021-10-06 18:04:16 +02:00
parent 1d96b4592a
commit 2fe4ae8b3a

View file

@ -616,7 +616,7 @@ class App(TestSuite):
def app_data_in_unofficial_dir(self): def app_data_in_unofficial_dir(self):
allowed_locations = ["/home/yunohost.app", "/home/yunohost.conf", "/home/yunohost.backup", "/home/yunohost.multimedia"] allowed_locations = ["/home/yunohost.app", "/home/yunohost.conf", "/home/yunohost.backup", "/home/yunohost.multimedia"]
cmd = "grep -IhEro '/home/yunohost[^/ ]*/' %s/scripts || true" % self.path cmd = "grep -IhEro '/home/yunohost[^/ ]*/|/home/\\$app' %s/scripts || true" % self.path
home_locations = subprocess.check_output(cmd, shell=True).decode('utf-8').strip().split("\n") home_locations = subprocess.check_output(cmd, shell=True).decode('utf-8').strip().split("\n")
forbidden_locations = set([location for location in home_locations if location and location.rstrip('/') not in allowed_locations]) forbidden_locations = set([location for location in home_locations if location and location.rstrip('/') not in allowed_locations])