Bug 30751 - Logfile test case (99check_log_files)
Logfile test case (99check_log_files)
Status: CLOSED FIXED
Product: UCS Test
Classification: Unclassified
Component: General
unspecified
Other Linux
: P5 normal (vote)
: UCS 3.2-x
Assigned To: Dmitry Galkin
Philipp Hahn
:
: 12764 12767 23117 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-11 22:01 CET by Stefan Gohmann
Modified: 2023-03-25 06:44 CET (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments
99check_log_files (1.64 KB, text/plain)
2013-03-11 22:01 CET, Stefan Gohmann
Details
Optimization: Join individual regular expression patterns into one regexp (11.88 KB, patch)
2014-09-03 10:07 CEST, Philipp Hahn
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gohmann univentionstaff 2013-03-11 22:01:10 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.
Comment 1 Stefan Gohmann univentionstaff 2013-11-15 21:21:39 CET
*** Bug 12764 has been marked as a duplicate of this bug. ***
Comment 2 Stefan Gohmann univentionstaff 2013-11-15 21:23:09 CET
*** Bug 23117 has been marked as a duplicate of this bug. ***
Comment 3 Stefan Gohmann univentionstaff 2013-11-15 21:23:26 CET
*** Bug 12767 has been marked as a duplicate of this bug. ***
Comment 4 Philipp Hahn univentionstaff 2014-07-22 09:15:53 CEST
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
Comment 5 Philipp Hahn univentionstaff 2014-07-22 10:52:15 CEST
There still exists ucs-test/tests/00_base/check_log_files_definitions.py, which should be removed after re-writing the test.
Comment 6 Dmitry Galkin univentionstaff 2014-08-01 11:24:21 CEST
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.
Comment 7 Dmitry Galkin univentionstaff 2014-08-26 16:54:32 CEST
(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.
Comment 8 Philipp Hahn univentionstaff 2014-09-03 10:03:48 CEST
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/>
Comment 9 Philipp Hahn univentionstaff 2014-09-03 10:07:20 CEST
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.
Comment 10 Philipp Hahn univentionstaff 2014-09-04 16:12:55 CEST
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'
Comment 11 Dmitry Galkin univentionstaff 2014-09-05 10:38:02 CEST
(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.
Comment 12 Dmitry Galkin univentionstaff 2014-09-05 10:56:48 CEST
(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).
Comment 13 Philipp Hahn univentionstaff 2014-09-05 11:39:52 CEST
(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.
Comment 14 Dmitry Galkin univentionstaff 2014-09-05 12:32:09 CEST
(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).
Comment 15 Philipp Hahn univentionstaff 2014-09-05 13:52:20 CEST
OK: r53397
OK: /usr/share/ucs-test/00_base/99check_log_files