Project

General

Profile

Actions

action #88319

closed

coordination #71242: [epic] Unify validation in the installed system

Unify config files validation implemented in verify_config_files and yast2_kdump.pm

Added by riafarov almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
SUSE QA - SLE 15 SP3
Start date:
2021-01-28
Due date:
% Done:

0%

Estimated time:

Description

As a test developer, I want to have flexible data driven way to validate configuration files.

We have different scenarios, as config files have different format, some have key-value syntax with = symbol, some like chrony.conf or /etc/hosts have lines format. We would rather avoid having test module for each of the config files, as this will lead to duplication of the code.

See https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/master/tests/console/yast2_kdump.pm and https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/master/tests/console/verify_config_files.pm

See for KDUMP https://openqa.suse.de/tests/latest?arch=x86_64&distri=sle&flavor=Online&machine=64bit&test=yast2_ncurses_textmode&version=15-SP3

We can either use generic structure to look for the full lines, or support both ways and define key-pair values, which is better visualized.

As of now have 2 ways to validate file, one uses script_output and other one uses grep inside of the system. Both have pros and cons, so we can start with any of those two and act in case we face any issues in future.

It has following structure:

kdump:
  - path: /etc/default/grub
    settings:
      GRUB_CMDLINE_LINUX_DEFAULT: '.*crashkernel=\d+M.*'
  - path: /etc/sysconfig/kdump
    settings:
      KDUMP_DUMPLEVEL: 31
      KDUMP_DUMPFORMAT: compressed
      KDUMP_SAVEDIR: '(file://|)/var/crash'
      KDUMP_KEEP_OLD_DUMPS: 5
      KDUMP_IMMEDIATE_REBOOT: 'yes'
      KDUMP_COPY_KERNEL: 'yes'

verify_config_files has following:

test_data:
  configuration_files:
    - path: /etc/hosts
      entries:
        - '10.226.154.19\tnew.entry.de h999uz'
    - path: /etc/chrony.conf
      entries:
        - pool ntp.suse.de iburst
        - driftfile /var/lib/chrony/drift
Actions #1

Updated by riafarov almost 4 years ago

  • Description updated (diff)
  • Status changed from New to Workable
Actions #2

Updated by riafarov almost 4 years ago

  • Status changed from Workable to In Progress
  • Assignee set to riafarov
Actions #4

Updated by riafarov almost 4 years ago

  • Status changed from In Progress to Feedback
Actions #5

Updated by riafarov almost 4 years ago

  • Status changed from Feedback to Closed
Actions

Also available in: Atom PDF