Univention Bugzilla – Bug 30751
Logfile test case (99check_log_files)
Last modified: 2023-03-25 06:44:21 CET
Created attachment 5121 [details] 99check_log_files The test case has been removed from ucs-test (00_base/99check_log_files). The test case fails every night. I attached the current version here. We should start with a new test case which is more tolerant.
*** Bug 12764 has been marked as a duplicate of this bug. ***
*** Bug 23117 has been marked as a duplicate of this bug. ***
*** Bug 12767 has been marked as a duplicate of this bug. ***
There should be separate tests which parse the following log files for errors and tracebacks: * /var/log/univention/installer.log, /var/log/univention/installation.log * /var/log/univention/join.log * /var/log/univention/listener.log * /var/log/univention/setup.log * /var/log/univention/updater.log
There still exists ucs-test/tests/00_base/check_log_files_definitions.py, which should be removed after re-writing the test.
Basing on previous implementation: r52452: * 00_base/check_log_files_definitions.py: extended and modified patterns, added separate case for tracebacks; 00_base/99check_log_files: a test to extract warnings, errors and tracebacks from the logs (Bug #30751) Note: bug not yet resolved, as most likely will be updated: - while managing the installation from the browser in EC2 (case when setup.log is being populated) observed that a gateway is not the one that was configured, i.e. setting it to 10.210.216.13, but after installation it is 10.210.0.1 -> this leads to a number of errors since instance cannot reach repositories and thus download/install packages. In config-registry.replog: 2014-07-29 08:29:16: set gateway=10.210.216.13 old:10.210.0.1 2014-07-29 08:29:21: set interfaces/restart/auto=false old:true 2014-07-29 08:29:21: set interfaces/eth0/broadcast=10.210.255.255 old:10.210.255.255 2014-07-29 08:29:21: set interfaces/eth0/address=10.210.218.217 old:10.210.218.217 2014-07-29 08:29:21: set interfaces/eth0/netmask=255.255.0.0 old:255.255.0.0 2014-07-29 08:29:21: set interfaces/eth0/network=10.210.0.0 old:10.210.0.0 2014-07-29 08:29:21: set gateway=10.210.0.1 old:10.210.216.13 2014-07-29 08:29:22: set interfaces/restart/auto=true old:false - also, some more error/warning messages should be reviewed and either ignored or their causes fixed.
(In reply to Dmitry Galkin from comment #6) > - also, some more error/warning messages should be reviewed and either > ignored or their causes fixed. As discussed, opened Bug #35705, Bug #35706, Bug #35707. The messages in '/var/log/univention/join.log' on S4 backup/slave seem to be caused by the Bug #31606. The test will be skipped until UCS 4.0-0 release.
r53263 | Bug #30751 test: 00_base/99check_log_files Package: ucs-test Version: 4.0.166-73.778.201409021611 Branch: ucs_3.2-0 Scope: errata3.2-3 OK: /usr/share/ucs-test/00_base/99check_log_files Wrong version OK: Bug #35705, Bug #35706, Bug #35707, Bug #31606 OK: <http://jenkins.knut.univention.de:8080/job/UCS-3.2/job/UCS-3.2-3/job/Autotest%20MultiEnv/lastCompletedBuild/testReport/>
Created attachment 6084 [details] Optimization: Join individual regular expression patterns into one regexp The current code compiles each line into its own regular expression object and iterates over them for each line. It's more efficient to concatenate all patterns into a single regular expression and to compile that once. Convert several grouping parenthesizes to the non-grouping variant.
This happened on UCS-4.0, but should be fixed for UCS-3.2-3: Traceback (most recent call last): File "99check_log_files", line 215, in <module> LogChecker.main(log_files) File "99check_log_files", line 185, in main self.check_installation_profile() File "99check_log_files", line 171, in check_installation_profile InstallProfile.load(filename='/etc/univention/installation_profile') File "/usr/lib/pymodules/python2.7/univention/management/console/modules/setup/setup_script.py", line 52, in load with open(filename, 'r') as profile: IOError: [Errno 2] Datei oder Verzeichnis nicht gefunden: '/etc/univention/installation_profile'
(In reply to Philipp Hahn from comment #10) > This happened on UCS-4.0, but should be fixed for UCS-3.2-3: > File > "/usr/lib/pymodules/python2.7/univention/management/console/modules/setup/ > setup_script.py", line 52, in load > with open(filename, 'r') as profile: > IOError: [Errno 2] Datei oder Verzeichnis nicht gefunden: > '/etc/univention/installation_profile' I would say it should be fixed on the level of: /base/univention-system-setup/umc/python/setup/setup_script.py As that is the module designed to work with Installation Profiles that is being used in this test. It does not handle missing files and also in the def load(self, filename=PATH_PROFILE) the PATH_PROFILE is imported from the module util, which with 3.2-3 giving: >>> from util import PATH_SETUP_SCRIPTS, PATH_PROFILE >>> >>> print PATH_PROFILE /var/cache/univention-system-setup/profile -> and this file '/var/cache/univention-system-setup/profile' does not exist.
(In reply to Philipp Hahn from comment #9) > Optimization: Join individual regular expression patterns into one regexp > > Convert several grouping parenthesizes to the non-grouping variant. Thanks, applied to 3.2-3 branch: r53396: * 00_base/99check_log_files and 00_base/check_log_files_definitions.py: applied patch by Philipp: Join individual regular expression patterns into one regexp (Bug #30751).
(In reply to Dmitry Galkin from comment #11) > (In reply to Philipp Hahn from comment #10) ... > > IOError: [Errno 2] Datei oder Verzeichnis nicht gefunden: > > '/etc/univention/installation_profile' > > I would say it should be fixed on the level of: > /base/univention-system-setup/umc/python/setup/setup_script.py Adding an exception for every possible open failure is IMHO a waste of time. Please handle the missing file the same as the system not being joined. > As that is the module designed to work with Installation Profiles that is > being used in this test. It was designed for running the very narrow case of univention-system-setup-boot, which uses the file '/var/cache/univention-system-setup/profile'. It only exists if you run u-s-s-boot.
(In reply to Philipp Hahn from comment #13) > > I would say it should be fixed on the level of: > > /base/univention-system-setup/umc/python/setup/setup_script.py > > Adding an exception for every possible open failure is IMHO a waste of time. > Please handle the missing file the same as the system not being joined. Alright then: r53397: * 00_base/99check_log_files: catch error if missing installation profile and treat it as system is not joined (Bug #30751).
OK: r53397 OK: /usr/share/ucs-test/00_base/99check_log_files