From a820a96849e295d4abc6238a01c650bf3663b774 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:33:31 +0200 Subject: Adding debian version 1:115.7.0-1~deb12u1. Signed-off-by: Daniel Baumann --- debian/tests/check-global-config-path.py | 61 ++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100755 debian/tests/check-global-config-path.py (limited to 'debian/tests/check-global-config-path.py') diff --git a/debian/tests/check-global-config-path.py b/debian/tests/check-global-config-path.py new file mode 100755 index 0000000000..3a2ec7c909 --- /dev/null +++ b/debian/tests/check-global-config-path.py @@ -0,0 +1,61 @@ +#!/usr/bin/python3 + +# Copyright 2021, Carsten Schoenert +# SPDX-License-Identifier: GPL-2.0+ + +# Simple check if the thunderbird binary is trying to successfully read any +# content of the folder /usr/lib/thunderbird/defaults/syspref which is a +# symlink to /etc/thunderbird/pref/ even if the folder is empty. +# +# Purpose if this check is to ensure we don't have disabled the inclusion of +# this folder for Thunderbird by accident as we ship important default settings +# within this folder. + +import subprocess +import sys + +# Set the CLI call we want to inspect. +command = 'strace -e trace=access thunderbird -h' +pattern = '/usr/lib/thunderbird/defaults/syspref' + +# Setup the sub-process object. +proc = subprocess.Popen(command, + shell=True, + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + +# Execute the call. +stdout_value,stderr_value = proc.communicate() + +# Once we have a valid response, split the return output. Currently we are not +# (yet) interested on the content for stdout. +if stdout_value: + stdout_value = stdout_value.split() + +# Processing and output the check. +print(f'\nOutput on stderr for command \'{command}\':\n') + +for line in stderr_value.splitlines(): + print(line.decode('utf-8')) +print() + +print('Analysing strace call:') +for line in stderr_value.splitlines(): + if f'{pattern}' in line.decode('utf-8'): + print(f'\tPattern for accessing \"{pattern}\" found.') + print('\t\t' + '---> ' + line.decode('utf-8')) + if '0' in line.decode('utf-8').split('=')[1].lstrip(): + print(f'\tAccess to folder/symlink \'{pattern}\' marked as successful (found F_OK = 0)') + print('\tCheck SUCCESSFUL!\n') + sys.exit(0) + + else: + print(f'\tFailed to access to folder/symlink \'{pattern}\'!!!') + print('\tCheck FAILED!\n') + sys.exit(1) + +# If we going until here we need to fix something! :-( +print(f'\tPattern for accessing \"{pattern}\" wasn\'t found!!!') +print('\tCheck FAILED!\n') +sys.exit(1) -- cgit v1.2.3