diff --git a/tests/functional/linux/os-linux-list-systemdservices.robot b/tests/functional/linux/os-linux-list-systemdservices.robot new file mode 100644 index 000000000..30f1a5375 --- /dev/null +++ b/tests/functional/linux/os-linux-list-systemdservices.robot @@ -0,0 +1,64 @@ +*** Settings *** +Documentation Linux Local list-systemdservices + +Library OperatingSystem +Library String +Library Examples + +Test Timeout 120s + + +*** Variables *** +${CENTREON_PLUGINS} ${CURDIR}${/}..${/}..${/}..${/}src${/}centreon_plugins.pl + +${CMD} perl ${CENTREON_PLUGINS} --plugin=os::linux::local::plugin +${PERCENT} % + +${COND} ${PERCENT}\{sub\} =~ /exited/ && ${PERCENT}{display} =~ /network/' + +*** Test Cases *** +List-Systemdservices v219 ${tc}/4 + [Documentation] Systemd version < 248 + [Tags] os linux local + ${command} Catenate + ... ${CMD} + ... --mode=list-systemdservices + ... --command-path=${CURDIR}${/}..${/}..${/}resources${/}linux${/}systemd-219 + ... --filter-name='${filtername}' + ... --filter-description='${filterdescription}' + + ${output} Run ${command} + ${output} Strip String ${output} + Should Be Equal As Strings + ... ${output} + ... ${expected_result} + ... \nWrong output result for command:\n${command}\n\nExpected:\n${expected_result}\nCommand output:\n${output}\n + + Examples: tc filtername filterdescription expected_result -- + ... 1 toto ${EMPTY} List systemd services: + ... 2 NetworkManager.service ${EMPTY} List systemd services: \n\'NetworkManager.service\' [desc = Network Manager] [load = loaded] [active = active] [sub = running] + ... 3 ${EMPTY} toto List systemd services: + ... 4 ${EMPTY} Permit User Sessions List systemd services: \n\'systemd-user-sessions.service\' [desc = Permit User Sessions] [load = loaded] [active = active] [sub = exited] + +List-Systemdservices v252 ${tc}/4 + [Documentation] Systemd version >= 248 + [Tags] os linux local + ${command} Catenate + ... ${CMD} + ... --mode=list-systemdservices + ... --command-path=${CURDIR}${/}..${/}..${/}resources${/}linux${/}systemd-252 + ... --filter-name='${filtername}' + ... --filter-description='${filterdescription}' + + ${output} Run ${command} + ${output} Strip String ${output} + Should Be Equal As Strings + ... ${output} + ... ${expected_result} + ... \nWrong output result for command:\n${command}\n\nExpected:\n${expected_result}\nCommand output:\n${output}\n + + Examples: tc filtername filterdescription expected_result -- + ... 1 toto ${EMPTY} List systemd services: + ... 2 NetworkManager.service ${EMPTY} List systemd services: \n\'NetworkManager.service\' [desc = Network Manager] [load = loaded] [active = active] [sub = running] + ... 3 ${EMPTY} toto List systemd services: + ... 4 ${EMPTY} Permit User Sessions List systemd services: \n\'systemd-user-sessions.service\' [desc = Permit User Sessions] [load = loaded] [active = active] [sub = exited] diff --git a/tests/functional/linux/os-linux-local.robot b/tests/functional/linux/os-linux-local.robot deleted file mode 100644 index 0a1446fa9..000000000 --- a/tests/functional/linux/os-linux-local.robot +++ /dev/null @@ -1,377 +0,0 @@ -*** Settings *** -Documentation OS Linux Local plugin - -Library OperatingSystem -Library String - -Test Timeout 120s - - -*** Variables *** -${CENTREON_PLUGINS} ${CURDIR}${/}..${/}..${/}..${/}src${/}centreon_plugins.pl - -${CMD} perl ${CENTREON_PLUGINS} --plugin=os::linux::local::plugin - -# Test list-systemdservices mode with filter-name option set to a fake value -&{linux_local_listsystemd_test1} -... filtername=toto -... filterdescription= -... result=List systemd services: - -# Test list-systemdservices mode with filter-name option set to a service name value -&{linux_local_listsystemd_test2} -... filtername=NetworkManager.service -... filterdescription= -... result=List systemd services: \n\'NetworkManager.service\' [desc = NetworkManager.service] [load = not-found] [active = inactive] [sub = dead] - -# Test list-systemdservices mode with filter-description option set to a fake value -&{linux_local_listsystemd_test3} -... filtername= -... filterdescription=toto -... result=List systemd services: - -# Test list-systemdservices mode with filter-description option set to a service description value -&{linux_local_listsystemd_test4} -... filtername= -... filterdescription='User Manager for UID 1001' -... result=List systemd services: \n\'user@1001.service\' [desc = User Manager for UID 1001] [load = loaded] [active = active] [sub = running] - -@{linux_local_listsystemd_tests} -... &{linux_local_listsystemd_test1} -... &{linux_local_listsystemd_test2} -... &{linux_local_listsystemd_test3} -... &{linux_local_listsystemd_test4} - -# Test simple usage of the systemd-sc-status mode -&{linux_local_systemd_test_1} -... filtername= -... excludename= -... warningstatus= -... criticalstatus= -... warningtotalrunning= -... criticaltotalrunning= -... warningtotaldead= -... criticaltotaldead= -... warningtotalexited= -... criticaltotalexited= -... warningtotalfailed= -... criticaltotalfailed= -... result=OK: Total Running: 40, Total Failed: 0, Total Dead: 120, Total Exited: 40 - All services are ok | 'total_running'=40;;;0;414 'total_failed'=0;;;0;414 'total_dead'=120;;;0;414 'total_exited'=40;;;0;414 - -# Test systemd-sc-status mode with filter-name option set to a fake value -&{linux_local_systemd_test_2} -... filtername=toto -... excludename= -... warningstatus= -... criticalstatus= -... warningtotalrunning= -... criticaltotalrunning= -... warningtotaldead= -... criticaltotaldead= -... warningtotalexited= -... criticaltotalexited= -... warningtotalfailed= -... criticaltotalfailed= -... result=UNKNOWN: No service found. - -# Test systemd-sc-status mode with filter-name option set to a service name value -&{linux_local_systemd_test_3} -... filtername=NetworkManager.service -... excludename= -... warningstatus= -... criticalstatus= -... warningtotalrunning= -... criticaltotalrunning= -... warningtotaldead= -... criticaltotaldead= -... warningtotalexited= -... criticaltotalexited= -... warningtotalfailed= -... criticaltotalfailed= -... result=OK: Total Running: 0, Total Failed: 0, Total Dead: 1, Total Exited: 0 - Service 'NetworkManager.service' status : not-found/inactive/dead [boot: -] | 'total_running'=0;;;0;1 'total_failed'=0;;;0;1 'total_dead'=1;;;0;1 'total_exited'=0;;;0;1 - -# Test systemd-sc-status mode with exclude-name option set to a fake value -&{linux_local_systemd_test_4} -... filtername= -... excludename=toto -... warningstatus= -... criticalstatus= -... warningtotalrunning= -... criticaltotalrunning= -... warningtotaldead= -... criticaltotaldead= -... warningtotalexited= -... criticaltotalexited= -... warningtotalfailed= -... criticaltotalfailed= -... result=OK: Total Running: 40, Total Failed: 0, Total Dead: 120, Total Exited: 40 - All services are ok | 'total_running'=40;;;0;414 'total_failed'=0;;;0;414 'total_dead'=120;;;0;414 'total_exited'=40;;;0;414 - -# Test systemd-sc-status mode with exclude-name option set to a service name value -&{linux_local_systemd_test_5} -... filtername= -... excludename=NetworkManager.service -... warningstatus= -... criticalstatus= -... warningtotalrunning= -... criticaltotalrunning= -... warningtotaldead= -... criticaltotaldead= -... warningtotalexited= -... criticaltotalexited= -... warningtotalfailed= -... criticaltotalfailed= -... result=OK: Total Running: 40, Total Failed: 0, Total Dead: 119, Total Exited: 40 - All services are ok | 'total_running'=40;;;0;413 'total_failed'=0;;;0;413 'total_dead'=119;;;0;413 'total_exited'=40;;;0;413 - -# Test systemd-sc-status mode with warning-status option set to '\%{sub} =~ /exited/ && \%{display} =~ /network/' -&{linux_local_systemd_test_6} -... filtername= -... excludename= -... warningstatus='\%{sub} =~ /exited/ && \%{display} =~ /network/' -... criticalstatus= -... warningtotalrunning= -... criticaltotalrunning= -... warningtotaldead= -... criticaltotaldead= -... warningtotalexited= -... criticaltotalexited= -... warningtotalfailed= -... criticaltotalfailed= -... result=WARNING: Service 'systemd-networkd-wait-online.service' status : loaded/active/exited [boot: enabled] - Service 'walinuxagent-network-setup.service' status : loaded/active/exited [boot: enabled] | 'total_running'=40;;;0;414 'total_failed'=0;;;0;414 'total_dead'=120;;;0;414 'total_exited'=40;;;0;414 - -# Test systemd-sc-status mode with critical-status option set to '\%{sub} =~ /exited/ && \%{display} =~ /network/' -&{linux_local_systemd_test_7} -... filtername= -... excludename= -... warningstatus= -... criticalstatus='\%{sub} =~ /exited/ && \%{display} =~ /network/' -... warningtotalrunning= -... criticaltotalrunning= -... warningtotaldead= -... criticaltotaldead= -... warningtotalexited= -... criticaltotalexited= -... warningtotalfailed= -... criticaltotalfailed= -... result=CRITICAL: Service 'systemd-networkd-wait-online.service' status : loaded/active/exited [boot: enabled] - Service 'walinuxagent-network-setup.service' status : loaded/active/exited [boot: enabled] | 'total_running'=40;;;0;414 'total_failed'=0;;;0;414 'total_dead'=120;;;0;414 'total_exited'=40;;;0;414 - -# Test systemd-sc-status mode with warning-total-running option set to 20 -&{linux_local_systemd_test_8} -... filtername= -... excludename= -... warningstatus= -... criticalstatus= -... warningtotalrunning=20 -... criticaltotalrunning= -... warningtotaldead= -... criticaltotaldead= -... warningtotalexited= -... criticaltotalexited= -... warningtotalfailed= -... criticaltotalfailed= -... result=WARNING: Total Running: 40 | 'total_running'=40;0:20;;0;414 'total_failed'=0;;;0;414 'total_dead'=120;;;0;414 'total_exited'=40;;;0;414 - -# Test systemd-sc-status mode with critical-total-running option set to 20 -&{linux_local_systemd_test_9} -... filtername= -... excludename= -... warningstatus= -... criticalstatus= -... warningtotalrunning= -... criticaltotalrunning=20 -... warningtotaldead= -... criticaltotaldead= -... warningtotalexited= -... criticaltotalexited= -... warningtotalfailed= -... criticaltotalfailed= -... result=CRITICAL: Total Running: 40 | 'total_running'=40;;0:20;0;414 'total_failed'=0;;;0;414 'total_dead'=120;;;0;414 'total_exited'=40;;;0;414 - -# Test systemd-sc-status mode with warning-total-dead option set to 20 -&{linux_local_systemd_test_10} -... filtername= -... excludename= -... warningstatus= -... criticalstatus= -... warningtotalrunning= -... criticaltotalrunning= -... warningtotaldead=20 -... criticaltotaldead= -... warningtotalexited= -... criticaltotalexited= -... warningtotalfailed= -... criticaltotalfailed= -... result=WARNING: Total Dead: 120 | 'total_running'=40;;;0;414 'total_failed'=0;;;0;414 'total_dead'=120;0:20;;0;414 'total_exited'=40;;;0;414 - -# Test systemd-sc-status mode with critical-total-dead option set to 20 -&{linux_local_systemd_test_11} -... filtername= -... excludename= -... warningstatus= -... criticalstatus= -... warningtotalrunning= -... criticaltotalrunning= -... warningtotaldead= -... criticaltotaldead=20 -... warningtotalexited= -... criticaltotalexited= -... warningtotalfailed= -... criticaltotalfailed= -... result=CRITICAL: Total Dead: 120 | 'total_running'=40;;;0;414 'total_failed'=0;;;0;414 'total_dead'=120;;0:20;0;414 'total_exited'=40;;;0;414 - -# Test systemd-sc-status mode with warning-total-exited option set to 20 -&{linux_local_systemd_test_12} -... filtername= -... excludename= -... warningstatus= -... criticalstatus= -... warningtotalrunning= -... criticaltotalrunning= -... warningtotaldead= -... criticaltotaldead= -... warningtotalexited=20 -... criticaltotalexited= -... warningtotalfailed= -... criticaltotalfailed= -... result=WARNING: Total Exited: 40 | 'total_running'=40;;;0;414 'total_failed'=0;;;0;414 'total_dead'=120;;;0;414 'total_exited'=40;0:20;;0;414 - -# Test systemd-sc-status mode with critical-total-exited option set to 20 -&{linux_local_systemd_test_13} -... filtername= -... excludename= -... warningstatus= -... criticalstatus= -... warningtotalrunning= -... criticaltotalrunning= -... warningtotaldead= -... criticaltotaldead= -... warningtotalexited= -... criticaltotalexited=20 -... warningtotalfailed= -... criticaltotalfailed= -... result=CRITICAL: Total Exited: 40 | 'total_running'=40;;;0;414 'total_failed'=0;;;0;414 'total_dead'=120;;;0;414 'total_exited'=40;;0:20;0;414 - -# Test systemd-sc-status mode with warning-total-failed option : NO DATA FOR THIS TEST - -# Test systemd-sc-status mode with critical-total-failed option : NO DATA FOR THIS TEST - -@{linux_local_systemd_tests} -... &{linux_local_systemd_test_1} -... &{linux_local_systemd_test_2} -... &{linux_local_systemd_test_3} -... &{linux_local_systemd_test_4} -... &{linux_local_systemd_test_5} -... &{linux_local_systemd_test_6} -... &{linux_local_systemd_test_7} -... &{linux_local_systemd_test_8} -... &{linux_local_systemd_test_9} -... &{linux_local_systemd_test_10} -... &{linux_local_systemd_test_11} -... &{linux_local_systemd_test_12} -... &{linux_local_systemd_test_13} - - -*** Test Cases *** -Linux Local Systemd-sc-status - [Documentation] Linux Local Systemd services status - [Tags] os linux local - FOR ${linux_local_systemd_test} IN @{linux_local_systemd_tests} - ${command} Catenate - ... ${CMD} - ... --mode=systemd-sc-status - ${length} Get Length ${linux_local_systemd_test.filtername} - IF ${length} > 0 - ${command} Catenate ${command} --filter-name=${linux_local_systemd_test.filtername} - END - ${length} Get Length ${linux_local_systemd_test.excludename} - IF ${length} > 0 - ${command} Catenate ${command} --exclude-name=${linux_local_systemd_test.excludename} - END - ${length} Get Length ${linux_local_systemd_test.warningstatus} - IF ${length} > 0 - ${command} Catenate ${command} --warning-status=${linux_local_systemd_test.warningstatus} - END - ${length} Get Length ${linux_local_systemd_test.criticalstatus} - IF ${length} > 0 - ${command} Catenate ${command} --critical-status=${linux_local_systemd_test.criticalstatus} - END - ${length} Get Length ${linux_local_systemd_test.warningtotalrunning} - IF ${length} > 0 - ${command} Catenate - ... ${command} - ... --warning-total-running=${linux_local_systemd_test.warningtotalrunning} - END - ${length} Get Length ${linux_local_systemd_test.criticaltotalrunning} - IF ${length} > 0 - ${command} Catenate - ... ${command} - ... --critical-total-running=${linux_local_systemd_test.criticaltotalrunning} - END - ${length} Get Length ${linux_local_systemd_test.warningtotaldead} - IF ${length} > 0 - ${command} Catenate ${command} --warning-total-dead=${linux_local_systemd_test.warningtotaldead} - END - ${length} Get Length ${linux_local_systemd_test.criticaltotaldead} - IF ${length} > 0 - ${command} Catenate ${command} --critical-total-dead=${linux_local_systemd_test.criticaltotaldead} - END - ${length} Get Length ${linux_local_systemd_test.warningtotalexited} - IF ${length} > 0 - ${command} Catenate - ... ${command} - ... --warning-total-exited=${linux_local_systemd_test.warningtotalexited} - END - ${length} Get Length ${linux_local_systemd_test.criticaltotalexited} - IF ${length} > 0 - ${command} Catenate - ... ${command} - ... --critical-total-exited=${linux_local_systemd_test.criticaltotalexited} - END - ${length} Get Length ${linux_local_systemd_test.warningtotalfailed} - IF ${length} > 0 - ${command} Catenate - ... ${command} - ... --warning-total-failed=${linux_local_systemd_test.warningtotalfailed} - END - ${length} Get Length ${linux_local_systemd_test.criticaltotalfailed} - IF ${length} > 0 - ${command} Catenate - ... ${command} - ... --critical-total-failed=${linux_local_systemd_test.criticaltotalfailed} - END - - ${output} Run ${command} - Log To Console . no_newline=true - ${output} Strip String ${output} - Should Be Equal As Strings - ... ${output} - ... ${linux_local_systemd_test.result} - ... Wrong result output for:${\n}Command: ${\n}${command}${\n}${\n}Expected output: ${\n}${linux_local_systemd_test.result}${\n}${\n}Obtained output:${\n}${output}${\n}${\n}${\n} - ... values=False - END - -Linux Local List-systemd-services - [Documentation] Linux Local List Systemd services - [Tags] os linux local - FOR ${linux_local_listsystemd_test} IN @{linux_local_listsystemd_tests} - ${command} Catenate - ... ${CMD} - ... --mode=list-systemdservices - ${length} Get Length ${linux_local_listsystemd_test.filtername} - IF ${length} > 0 - ${command} Catenate ${command} --filter-name=${linux_local_listsystemd_test.filtername} - END - ${length} Get Length ${linux_local_listsystemd_test.filterdescription} - IF ${length} > 0 - ${command} Catenate - ... ${command} - ... --filter-description=${linux_local_listsystemd_test.filterdescription} - END - - ${output} Run ${command} - ${output} Strip String ${output} - Should Be Equal As Strings - ... ${output} - ... ${linux_local_listsystemd_test.result} - ... Wrong result output for:${\n}Command: ${\n}${command}${\n}${\n}Expected output: ${\n}${linux_local_listsystemd_test.result}${\n}${\n}Obtained output:${\n}${output}${\n}${\n}${\n} - ... values=False - END diff --git a/tests/functional/linux/os-linux-system-sc-status.robot b/tests/functional/linux/os-linux-system-sc-status.robot new file mode 100644 index 000000000..f6de4194f --- /dev/null +++ b/tests/functional/linux/os-linux-system-sc-status.robot @@ -0,0 +1,110 @@ +*** Settings *** +Documentation Linux Local Systemd-sc-status + +Library OperatingSystem +Library String +Library Examples + +Test Timeout 120s + + +*** Variables *** +${CENTREON_PLUGINS} ${CURDIR}${/}..${/}..${/}..${/}src${/}centreon_plugins.pl + +${CMD} perl ${CENTREON_PLUGINS} --plugin=os::linux::local::plugin +# attempt to work around the interpretation of %{} as env variables instead of plugin macros +#${PERCENT} % +#${COND} ${PERCENT}\{sub\} =~ /exited/ && ${PERCENT}{display} =~ /network/' + +*** Test Cases *** +Systemd-sc-status v219 ${tc}/15 + [Documentation] Systemd version < 248 + [Tags] os linux local + ${command} Catenate + ... ${CMD} + ... --mode=systemd-sc-status + ... --command-path=${CURDIR}${/}..${/}..${/}resources${/}linux${/}systemd-219 + ... --filter-name='${filter}' + ... --exclude-name='${exclude}' + ... --warning-status='${w_stat}' + ... --critical-status='${c_stat}' + ... --warning-total-running='${w_running}' + ... --critical-total-running='${c_running}' + ... --warning-total-dead='${w_dead}' + ... --critical-total-dead='${c_dead}' + ... --warning-total-exited='${w_exited}' + ... --critical-total-exited='${c_exited}' + ... --warning-total-failed='${w_failed}' + ... --critical-total-failed='${c_failed}' + + ${output} Run ${command} + ${output} Strip String ${output} + Should Be Equal As Strings + ... ${output} + ... ${expected_result} + ... \nWrong output result for command:\n${command}\n\nExpected:\n${expected_result}\nCommand output:\n${output}\n + + Examples: tc filter exclude w_stat c_stat w_running c_running w_dead c_dead w_exited c_exited w_failed c_failed expected_result -- + ... 1 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} OK: Total Running: 34, Total Failed: 1, Total Dead: 97, Total Exited: 25 - All services are ok | 'total_running'=34;;;0;220 'total_failed'=1;;;0;220 'total_dead'=97;;;0;220 'total_exited'=25;;;0;220 + ... 2 toto ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} UNKNOWN: No service found. + ... 3 NetworkManager ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} OK: Total Running: 1, Total Failed: 0, Total Dead: 0, Total Exited: 1 - All services are ok | 'total_running'=1;;;0;2 'total_failed'=0;;;0;2 'total_dead'=0;;;0;2 'total_exited'=1;;;0;2 + ... 4 ${EMPTY} Manager ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} OK: Total Running: 33, Total Failed: 1, Total Dead: 97, Total Exited: 24 - All services are ok | 'total_running'=33;;;0;218 'total_failed'=1;;;0;218 'total_dead'=97;;;0;218 'total_exited'=24;;;0;218 + ... 5 NetworkManager ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} OK: Total Running: 1, Total Failed: 0, Total Dead: 0, Total Exited: 1 - All services are ok | 'total_running'=1;;;0;2 'total_failed'=0;;;0;2 'total_dead'=0;;;0;2 'total_exited'=1;;;0;2 + ... 8 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 0 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} WARNING: Total Running: 34 | 'total_running'=34;0:0;;0;220 'total_failed'=1;;;0;220 'total_dead'=97;;;0;220 'total_exited'=25;;;0;220 + ... 9 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 0 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} CRITICAL: Total Running: 34 | 'total_running'=34;;0:0;0;220 'total_failed'=1;;;0;220 'total_dead'=97;;;0;220 'total_exited'=25;;;0;220 + ... 10 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 0 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} WARNING: Total Dead: 97 | 'total_running'=34;;;0;220 'total_failed'=1;;;0;220 'total_dead'=97;0:0;;0;220 'total_exited'=25;;;0;220 + ... 11 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 0 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} CRITICAL: Total Dead: 97 | 'total_running'=34;;;0;220 'total_failed'=1;;;0;220 'total_dead'=97;;0:0;0;220 'total_exited'=25;;;0;220 + ... 12 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 0 ${EMPTY} ${EMPTY} ${EMPTY} WARNING: Total Exited: 25 | 'total_running'=34;;;0;220 'total_failed'=1;;;0;220 'total_dead'=97;;;0;220 'total_exited'=25;0:0;;0;220 + ... 13 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 0 ${EMPTY} ${EMPTY} CRITICAL: Total Exited: 25 | 'total_running'=34;;;0;220 'total_failed'=1;;;0;220 'total_dead'=97;;;0;220 'total_exited'=25;;0:0;0;220 + ... 14 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 0 ${EMPTY} WARNING: Total Failed: 1 | 'total_running'=34;;;0;220 'total_failed'=1;0:0;;0;220 'total_dead'=97;;;0;220 'total_exited'=25;;;0;220 + ... 15 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 0 CRITICAL: Total Failed: 1 | 'total_running'=34;;;0;220 'total_failed'=1;;0:0;0;220 'total_dead'=97;;;0;220 'total_exited'=25;;;0;220 +# not working atm + # ... 6 ${EMPTY} ${EMPTY} ${COND} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} WARNING + # ... 7 ${EMPTY} ${EMPTY} ${EMPTY} ${COND} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} CRITICAL + +Systemd-sc-status v252 ${tc}/15 + [Documentation] Systemd version >= 248 + [Tags] os linux local + ${command} Catenate + ... ${CMD} + ... --mode=systemd-sc-status + ... --command-path=${CURDIR}${/}..${/}..${/}resources${/}linux${/}systemd-252 + ... --filter-name='${filter}' + ... --exclude-name='${exclude}' + ... --warning-status='${w_stat}' + ... --critical-status='${c_stat}' + ... --warning-total-running='${w_running}' + ... --critical-total-running='${c_running}' + ... --warning-total-dead='${w_dead}' + ... --critical-total-dead='${c_dead}' + ... --warning-total-exited='${w_exited}' + ... --critical-total-exited='${c_exited}' + ... --warning-total-failed='${w_failed}' + ... --critical-total-failed='${c_failed}' + + ${output} Run ${command} + ${output} Strip String ${output} + Should Be Equal As Strings + ... ${output} + ... ${expected_result} + ... Wrong output result for command:\n${command}\n\nExpected:\n${expected_result}\nCommand output:\n${output}\n\n + + Examples: tc filter exclude w_stat c_stat w_running c_running w_dead c_dead w_exited c_exited w_failed c_failed expected_result -- + ... 1 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} OK: Total Running: 31, Total Failed: 4, Total Dead: 108, Total Exited: 19 - All services are ok | 'total_running'=31;;;0;258 'total_failed'=4;;;0;258 'total_dead'=108;;;0;258 'total_exited'=19;;;0;258 + ... 2 toto ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} UNKNOWN: No service found. + ... 3 NetworkManager ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} OK: Total Running: 1, Total Failed: 0, Total Dead: 0, Total Exited: 1 - All services are ok | 'total_running'=1;;;0;2 'total_failed'=0;;;0;2 'total_dead'=0;;;0;2 'total_exited'=1;;;0;2 + ... 4 ${EMPTY} Manager ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} OK: Total Running: 30, Total Failed: 4, Total Dead: 108, Total Exited: 18 - All services are ok | 'total_running'=30;;;0;256 'total_failed'=4;;;0;256 'total_dead'=108;;;0;256 'total_exited'=18;;;0;256 + ... 5 NetworkManager ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} OK: Total Running: 1, Total Failed: 0, Total Dead: 0, Total Exited: 1 - All services are ok | 'total_running'=1;;;0;2 'total_failed'=0;;;0;2 'total_dead'=0;;;0;2 'total_exited'=1;;;0;2 + ... 8 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 2 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} WARNING: Total Running: 31 | 'total_running'=31;0:2;;0;258 'total_failed'=4;;;0;258 'total_dead'=108;;;0;258 'total_exited'=19;;;0;258 + ... 9 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 2 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} CRITICAL: Total Running: 31 | 'total_running'=31;;0:2;0;258 'total_failed'=4;;;0;258 'total_dead'=108;;;0;258 'total_exited'=19;;;0;258 + ... 10 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 2 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} WARNING: Total Dead: 108 | 'total_running'=31;;;0;258 'total_failed'=4;;;0;258 'total_dead'=108;0:2;;0;258 'total_exited'=19;;;0;258 + ... 11 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 2 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} CRITICAL: Total Dead: 108 | 'total_running'=31;;;0;258 'total_failed'=4;;;0;258 'total_dead'=108;;0:2;0;258 'total_exited'=19;;;0;258 + ... 12 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 2 ${EMPTY} ${EMPTY} ${EMPTY} WARNING: Total Exited: 19 | 'total_running'=31;;;0;258 'total_failed'=4;;;0;258 'total_dead'=108;;;0;258 'total_exited'=19;0:2;;0;258 + ... 13 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 2 ${EMPTY} ${EMPTY} CRITICAL: Total Exited: 19 | 'total_running'=31;;;0;258 'total_failed'=4;;;0;258 'total_dead'=108;;;0;258 'total_exited'=19;;0:2;0;258 + ... 14 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 2 ${EMPTY} WARNING: Total Failed: 4 | 'total_running'=31;;;0;258 'total_failed'=4;0:2;;0;258 'total_dead'=108;;;0;258 'total_exited'=19;;;0;258 + ... 15 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 2 CRITICAL: Total Failed: 4 | 'total_running'=31;;;0;258 'total_failed'=4;;0:2;0;258 'total_dead'=108;;;0;258 'total_exited'=19;;;0;258 + +# not working atm + # ... 6 ${EMPTY} ${EMPTY} ${COND} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} WARNING + # ... 7 ${EMPTY} ${EMPTY} ${EMPTY} ${COND} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} CRITICAL + diff --git a/tests/resources/linux/systemd-219/systemctl b/tests/resources/linux/systemd-219/systemctl new file mode 100755 index 000000000..f2c9ea701 --- /dev/null +++ b/tests/resources/linux/systemd-219/systemctl @@ -0,0 +1,237 @@ +#!/bin/bash +case "$*" in + --version) + cat <<'EOF' +systemd 219 ++PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 -SECCOMP +BLKID +ELFUTILS +KMOD +IDN +EOF + ;; + '-a --no-pager --plain --no-legend') + cat <<'EOF' +proc-sys-fs-binfmt_misc.automount loaded active waiting Arbitrary Executable File Formats File System +dev-disk-by\x2did-scsi\x2d0QEMU_QEMU_HARDDISK_drive\x2dscsi0\x2d0\x2d0\x2d0.device loaded active plugged QEMU_HARDDISK +dev-disk-by\x2did-scsi\x2d0QEMU_QEMU_HARDDISK_drive\x2dscsi0\x2d0\x2d0\x2d0\x2dpart1.device loaded active plugged QEMU_HARDDISK 1 +dev-disk-by\x2dpath-pci\x2d0000:00:04.0\x2dscsi\x2d0:0:0:0.device loaded active plugged QEMU_HARDDISK +dev-disk-by\x2dpath-pci\x2d0000:00:04.0\x2dscsi\x2d0:0:0:0\x2dpart1.device loaded active plugged QEMU_HARDDISK 1 +dev-disk-by\x2duuid-85ea49f1\x2d50e9\x2d4dc2\x2d83e4\x2d76499dffa11b.device loaded active plugged QEMU_HARDDISK 1 +dev-sda.device loaded active plugged QEMU_HARDDISK +dev-sda1.device loaded active plugged QEMU_HARDDISK 1 +dev-ttyS0.device loaded active plugged /dev/ttyS0 +dev-ttyS1.device loaded active plugged /dev/ttyS1 +dev-ttyS2.device loaded active plugged /dev/ttyS2 +dev-ttyS3.device loaded active plugged /dev/ttyS3 +dev-virtio\x2dports-org.qemu.guest_agent.0.device loaded active plugged /dev/virtio-ports/org.qemu.guest_agent.0 +dev-vport2p1.device loaded active plugged /dev/vport2p1 +sys-devices-pci0000:00-0000:00:03.0-virtio0-net-eth0.device loaded active plugged Virtio network device +sys-devices-pci0000:00-0000:00:04.0-virtio1-host2-target2:0:0-2:0:0:0-block-sda-sda1.device loaded active plugged QEMU_HARDDISK 1 +sys-devices-pci0000:00-0000:00:04.0-virtio1-host2-target2:0:0-2:0:0:0-block-sda.device loaded active plugged QEMU_HARDDISK +sys-devices-pci0000:00-0000:00:05.0-virtio2-virtio\x2dports-vport2p1.device loaded active plugged /sys/devices/pci0000:00/0000:00:05.0/virtio2/v +sys-devices-platform-serial8250-tty-ttyS1.device loaded active plugged /sys/devices/platform/serial8250/tty/ttyS1 +sys-devices-platform-serial8250-tty-ttyS2.device loaded active plugged /sys/devices/platform/serial8250/tty/ttyS2 +sys-devices-platform-serial8250-tty-ttyS3.device loaded active plugged /sys/devices/platform/serial8250/tty/ttyS3 +sys-devices-pnp0-00:04-tty-ttyS0.device loaded active plugged /sys/devices/pnp0/00:04/tty/ttyS0 +sys-module-configfs.device loaded active plugged /sys/module/configfs +sys-subsystem-net-devices-eth0.device loaded active plugged Virtio network device +-.mount loaded active mounted / +dev-hugepages.mount loaded active mounted Huge Pages File System +dev-mqueue.mount loaded active mounted POSIX Message Queue File System +proc-sys-fs-binfmt_misc.mount loaded inactive dead Arbitrary Executable File Formats File System +run-user-0.mount loaded active mounted /run/user/0 +sys-fs-fuse-connections.mount loaded inactive dead FUSE Control File System +sys-kernel-config.mount loaded active mounted Configuration File System +sys-kernel-debug.mount loaded active mounted Debug File System +sysroot.mount not-found inactive dead sysroot.mount +tmp.mount loaded inactive dead Temporary Directory +var-run.mount not-found inactive dead var-run.mount +brandbot.path loaded active waiting Flexible branding +systemd-ask-password-console.path loaded inactive dead Dispatch Password Requests to Console Director +systemd-ask-password-plymouth.path loaded active waiting Forward Password Requests to Plymouth Director +systemd-ask-password-wall.path loaded active waiting Forward Password Requests to Wall Directory Wa +session-187554.scope loaded active running Session 187554 of user root +atd.service loaded active running Job spooling tools +auditd.service loaded active running Security Auditing Service +brandbot.service loaded inactive dead Flexible Branding Service +cbd.service loaded active running Centreon Broker watchdog +centcore.service not-found inactive dead centcore.service +centengine.service loaded active running Centreon Engine +centreon-map.service loaded failed failed Centreon Studio map server +centreon-nrpe3.service loaded active running Nagios Remote Program Executor +centreon.service loaded active exited One Service to rule them all. +chronyd.service loaded active running NTP client/server +cloud-config.service loaded active exited Apply the settings specified in cloud-config +cloud-final.service loaded active exited Execute cloud user/final scripts +cloud-init-local.service loaded active exited Initial cloud-init job (pre-networking) +cloud-init.service loaded active exited Initial cloud-init job (metadata service crawl +cpupower.service loaded inactive dead Configure CPU power related settings +crond.service loaded active running Command Scheduler +dbus.service loaded active running D-Bus System Message Bus +display-manager.service not-found inactive dead display-manager.service +dm-event.service loaded inactive dead Device-mapper event daemon +dracut-cmdline.service loaded inactive dead dracut cmdline hook +dracut-initqueue.service loaded inactive dead dracut initqueue hook +dracut-mount.service loaded inactive dead dracut mount hook +dracut-pre-mount.service loaded inactive dead dracut pre-mount hook +dracut-pre-pivot.service loaded inactive dead dracut pre-pivot and cleanup hook +dracut-pre-trigger.service loaded inactive dead dracut pre-trigger hook +dracut-pre-udev.service loaded inactive dead dracut pre-udev hook +dracut-shutdown.service loaded inactive dead Restore /run/initramfs +ebtables.service loaded inactive dead Ethernet Bridge Filtering tables +emergency.service loaded inactive dead Emergency Shell +exim.service not-found inactive dead exim.service +firewalld.service loaded active running firewalld - dynamic firewall daemon +getty@tty1.service loaded active running Getty on tty1 +gorgoned.service loaded active running Centreon Gorgone +haproxy.service loaded active running HAProxy Load Balancer +httpd24-httpd.service loaded active running The Apache HTTP Server +initrd-cleanup.service loaded inactive dead Cleaning Up and Shutting Down Daemons +initrd-parse-etc.service loaded inactive dead Reload Configuration from the Real Root +initrd-switch-root.service loaded inactive dead Switch Root +initrd-udevadm-cleanup-db.service loaded inactive dead Cleanup udevd DB +ip6tables.service not-found inactive dead ip6tables.service +ipset.service not-found inactive dead ipset.service +iptables.service not-found inactive dead iptables.service +irqbalance.service loaded inactive dead irqbalance daemon +kdump.service loaded active exited Crash recovery kernel arming +kmod-static-nodes.service loaded active exited Create list of required static device nodes fo +lvm2-activation.service not-found inactive dead lvm2-activation.service +lvm2-lvmetad.service loaded active running LVM2 metadata daemon +lvm2-lvmpolld.service loaded inactive dead LVM2 poll daemon +lvm2-monitor.service loaded active exited Monitoring of LVM2 mirrors, snapshots etc. usi +mariadb.service loaded active running MariaDB 10.5.17 database server +microcode.service loaded inactive dead Load CPU microcode update +network.service loaded active exited LSB: Bring up/down networking +NetworkManager-wait-online.service loaded active exited Network Manager Wait Online +NetworkManager.service loaded active running Network Manager +ntpd.service not-found inactive dead ntpd.service +ntpdate.service not-found inactive dead ntpdate.service +php-fpm.service loaded active running The PHP FastCGI Process Manager +plymouth-quit-wait.service loaded inactive dead Wait for Plymouth Boot Screen to Quit +plymouth-quit.service loaded inactive dead Terminate Plymouth Boot Screen +plymouth-read-write.service loaded inactive dead Tell Plymouth To Write Out Runtime Data +plymouth-start.service loaded inactive dead Show Plymouth Boot Screen +plymouth-switch-root.service loaded inactive dead Plymouth switch root service +polkit.service loaded active running Authorization Manager +postfix.service loaded active running Postfix Mail Transport Agent +rc-local.service loaded inactive dead /etc/rc.d/rc.local Compatibility +rescue.service loaded inactive dead Rescue Shell +rhel-autorelabel-mark.service loaded inactive dead Mark the need to relabel after reboot +rhel-autorelabel.service loaded inactive dead Relabel all filesystems, if necessary +rhel-configure.service loaded inactive dead Reconfigure the system on administrator reques +rhel-dmesg.service loaded active exited Dump dmesg to /var/log/dmesg +rhel-domainname.service loaded active exited Read and set NIS domainname from /etc/sysconfi +rhel-import-state.service loaded active exited Import network configuration from initramfs +rhel-loadmodules.service loaded inactive dead Load legacy module configuration +rhel-readonly.service loaded active exited Configure read-only root support +rpcbind.service loaded active running RPC bind service +rsyslog.service loaded active running System Logging Service +selinux-policy-migrate-local-changes@targeted.service loaded inactive dead Migrate local SELinux policy changes from the +sendmail.service not-found inactive dead sendmail.service +snmpd.service loaded active running Simple Network Management Protocol (SNMP) Daem +sntp.service not-found inactive dead sntp.service +sshd-keygen.service loaded inactive dead OpenSSH Server Key Generation +sshd.service loaded active running OpenSSH server daemon +syslog.service not-found inactive dead syslog.service +systemd-ask-password-console.service loaded inactive dead Dispatch Password Requests to Console +systemd-ask-password-plymouth.service loaded inactive dead Forward Password Requests to Plymouth +systemd-ask-password-wall.service loaded inactive dead Forward Password Requests to Wall +systemd-binfmt.service loaded inactive dead Set Up Additional Binary Formats +systemd-firstboot.service loaded inactive dead First Boot Wizard +systemd-fsck-root.service loaded active exited File System Check on Root Device +systemd-hwdb-update.service loaded inactive dead Rebuild Hardware Database +systemd-initctl.service loaded inactive dead /dev/initctl Compatibility Daemon +systemd-journal-catalog-update.service loaded inactive dead Rebuild Journal Catalog +systemd-journal-flush.service loaded active exited Flush Journal to Persistent Storage +systemd-journald.service loaded active running Journal Service +systemd-logind.service loaded active running Login Service +systemd-machine-id-commit.service loaded inactive dead Commit a transient machine-id on disk +systemd-modules-load.service loaded inactive dead Load Kernel Modules +systemd-random-seed.service loaded active exited Load/Save Random Seed +systemd-readahead-collect.service loaded inactive dead Collect Read-Ahead Data +systemd-readahead-done.service loaded inactive dead Stop Read-Ahead Data Collection +systemd-readahead-replay.service loaded inactive dead Replay Read-Ahead Data +systemd-reboot.service loaded inactive dead Reboot +systemd-remount-fs.service loaded active exited Remount Root and Kernel File Systems +systemd-shutdownd.service loaded inactive dead Delayed Shutdown Service +systemd-sysctl.service loaded active exited Apply Kernel Variables +systemd-sysusers.service not-found inactive dead systemd-sysusers.service +systemd-timesyncd.service not-found inactive dead systemd-timesyncd.service +systemd-tmpfiles-clean.service loaded inactive dead Cleanup of Temporary Directories +systemd-tmpfiles-setup-dev.service loaded active exited Create Static Device Nodes in /dev +systemd-tmpfiles-setup.service loaded active exited Create Volatile Files and Directories +systemd-udev-trigger.service loaded active exited udev Coldplug all Devices +systemd-udevd.service loaded active running udev Kernel Device Manager +systemd-update-done.service loaded inactive dead Update is Completed +systemd-update-utmp-runlevel.service loaded inactive dead Update UTMP about System Runlevel Changes +systemd-update-utmp.service loaded active exited Update UTMP about System Boot/Shutdown +systemd-user-sessions.service loaded active exited Permit User Sessions +systemd-vconsole-setup.service loaded active exited Setup Virtual Console +tuned.service loaded active running Dynamic System Tuning Daemon +xdm.service not-found inactive dead xdm.service +ypbind.service not-found inactive dead ypbind.service +yppasswdd.service not-found inactive dead yppasswdd.service +ypserv.service not-found inactive dead ypserv.service +ypxfrd.service not-found inactive dead ypxfrd.service +-.slice loaded active active Root Slice +system-getty.slice loaded active active system-getty.slice +system-selinux\x2dpolicy\x2dmigrate\x2dlocal\x2dchanges.slice loaded active active system-selinux\x2dpolicy\x2dmigrate\x2dlocal\x +system.slice loaded active active System Slice +user-0.slice loaded active active User Slice of root +user.slice loaded active active User and Session Slice +dbus.socket loaded active running D-Bus System Message Bus Socket +dm-event.socket loaded active listening Device-mapper event daemon FIFOs +lvm2-lvmetad.socket loaded active running LVM2 metadata daemon socket +lvm2-lvmpolld.socket loaded active listening LVM2 poll daemon socket +nrpe.socket not-found inactive dead nrpe.socket +rpcbind.socket loaded active running RPCbind Server Activation Socket +sshd.socket loaded inactive dead OpenSSH Server Socket +syslog.socket loaded inactive dead Syslog Socket +systemd-initctl.socket loaded active listening /dev/initctl Compatibility Named Pipe +systemd-journald.socket loaded active running Journal Socket +systemd-shutdownd.socket loaded active listening Delayed Shutdown Socket +systemd-udevd-control.socket loaded active running udev Control Socket +systemd-udevd-kernel.socket loaded active running udev Kernel Socket +basic.target loaded active active Basic System +cloud-config.target loaded active active Cloud-config availability +cloud-init.target loaded active active Cloud-init target +cryptsetup.target loaded active active Local Encrypted Volumes +emergency.target loaded inactive dead Emergency Mode +final.target loaded inactive dead Final Step +firewalld.target not-found inactive dead firewalld.target +getty-pre.target loaded inactive dead Login Prompts (Pre) +getty.target loaded active active Login Prompts +graphical.target loaded inactive dead Graphical Interface +initrd-fs.target loaded inactive dead Initrd File Systems +initrd-root-fs.target loaded inactive dead Initrd Root File System +initrd-switch-root.target loaded inactive dead Switch Root +initrd.target loaded inactive dead Initrd Default Target +local-fs-pre.target loaded active active Local File Systems (Pre) +local-fs.target loaded active active Local File Systems +multi-user.target loaded active active Multi-User System +network-online.target loaded active active Network is Online +network-pre.target loaded active active Network (Pre) +network.target loaded active active Network +nss-lookup.target loaded inactive dead Host and Network Name Lookups +nss-user-lookup.target loaded inactive dead User and Group Name Lookups +paths.target loaded active active Paths +remote-fs-pre.target loaded inactive dead Remote File Systems (Pre) +remote-fs.target loaded active active Remote File Systems +rescue.target loaded inactive dead Rescue Mode +rpcbind.target loaded active active RPC Port Mapper +shutdown.target loaded inactive dead Shutdown +slices.target loaded active active Slices +sockets.target loaded active active Sockets +swap.target loaded active active Swap +sysinit.target loaded active active System Initialization +syslog.target not-found inactive dead syslog.target +time-sync.target loaded inactive dead System Time Synchronized +timers.target loaded active active Timers +umount.target loaded inactive dead Unmount All Filesystems +systemd-readahead-done.timer loaded inactive dead Stop Read-Ahead Data Collection 10s After Comp +systemd-tmpfiles-clean.timer loaded active waiting Daily Cleanup of Temporary Directories +EOF + ;; + *) + echo "Unknown option" + ;; +esac + diff --git a/tests/resources/linux/systemd-252/systemctl b/tests/resources/linux/systemd-252/systemctl new file mode 100755 index 000000000..4294c3732 --- /dev/null +++ b/tests/resources/linux/systemd-252/systemctl @@ -0,0 +1,275 @@ +#!/bin/bash +case "$*" in + --version) + cat <<'EOF' +systemd 252 (252-18.el9) ++PAM +AUDIT +SELINUX -APPARMOR +IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS -FIDO2 +IDN2 -IDN -IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT -QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD -BPF_FRAMEWORK +XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified +EOF + ;; + '-a --no-pager --plain --legend=false') + cat <<'EOF' +boot.automount not-found inactive dead boot.automount +proc-sys-fs-binfmt_misc.automount loaded active waiting Arbitrary Executable File Formats File Syst… +dev-disk-by\x2ddiskseq-1.device loaded active plugged VBOX_HARDDISK +dev-disk-by\x2did-ata\x2dVBOX_HARDDISK_VBd2… loaded active plugged VBOX_HARDDISK +dev-disk-by\x2did-ata\x2dVBOX_HARDDISK_VBd2… loaded active plugged VBOX_HARDDISK 1 +dev-disk-by\x2did-ata\x2dVBOX_HARDDISK_VBd2… loaded active plugged VBOX_HARDDISK 2 +dev-disk-by\x2did-scsi\x2d0ATA_VBOX_HARDDIS… loaded active plugged VBOX_HARDDISK +dev-disk-by\x2did-scsi\x2d0ATA_VBOX_HARDDIS… loaded active plugged VBOX_HARDDISK 1 +dev-disk-by\x2did-scsi\x2d0ATA_VBOX_HARDDIS… loaded active plugged VBOX_HARDDISK 2 +dev-disk-by\x2did-scsi\x2d1ATA_VBOX_HARDDIS… loaded active plugged VBOX_HARDDISK +dev-disk-by\x2did-scsi\x2d1ATA_VBOX_HARDDIS… loaded active plugged VBOX_HARDDISK 1 +dev-disk-by\x2did-scsi\x2d1ATA_VBOX_HARDDIS… loaded active plugged VBOX_HARDDISK 2 +dev-disk-by\x2did-scsi\x2dSATA_VBOX_HARDDIS… loaded active plugged VBOX_HARDDISK +dev-disk-by\x2did-scsi\x2dSATA_VBOX_HARDDIS… loaded active plugged VBOX_HARDDISK 1 +dev-disk-by\x2did-scsi\x2dSATA_VBOX_HARDDIS… loaded active plugged VBOX_HARDDISK 2 +dev-disk-by\x2dpartuuid-44ac7039\x2d2ef4\x2… loaded active plugged VBOX_HARDDISK 1 +dev-disk-by\x2dpartuuid-4d2e7c69\x2d19ea\x2… loaded active plugged VBOX_HARDDISK 2 +dev-disk-by\x2dpath-pci\x2d0000:00:0d.0\x2d… loaded active plugged VBOX_HARDDISK +dev-disk-by\x2dpath-pci\x2d0000:00:0d.0\x2d… loaded active plugged VBOX_HARDDISK 1 +dev-disk-by\x2dpath-pci\x2d0000:00:0d.0\x2d… loaded active plugged VBOX_HARDDISK 2 +dev-disk-by\x2dpath-pci\x2d0000:00:0d.0\x2d… loaded active plugged VBOX_HARDDISK +dev-disk-by\x2dpath-pci\x2d0000:00:0d.0\x2d… loaded active plugged VBOX_HARDDISK 1 +dev-disk-by\x2dpath-pci\x2d0000:00:0d.0\x2d… loaded active plugged VBOX_HARDDISK 2 +dev-disk-by\x2duuid-04468d69\x2ddd58\x2d4fc… loaded active plugged VBOX_HARDDISK 2 +dev-rfkill.device loaded active plugged /dev/rfkill +dev-sda.device loaded active plugged VBOX_HARDDISK +dev-sda1.device loaded active plugged VBOX_HARDDISK 1 +dev-sda2.device loaded active plugged VBOX_HARDDISK 2 +dev-ttyS0.device loaded active plugged /dev/ttyS0 +dev-ttyS1.device loaded active plugged /dev/ttyS1 +dev-ttyS2.device loaded active plugged /dev/ttyS2 +dev-ttyS3.device loaded active plugged /dev/ttyS3 +sys-devices-pci0000:00-0000:00:03.0-net-enp… loaded active plugged 82540EM Gigabit Ethernet Controller (PRO/10… +sys-devices-pci0000:00-0000:00:08.0-net-enp… loaded active plugged 82540EM Gigabit Ethernet Controller (PRO/10… +sys-devices-pci0000:00-0000:00:0d.0-ata3-ho… loaded active plugged VBOX_HARDDISK 1 +sys-devices-pci0000:00-0000:00:0d.0-ata3-ho… loaded active plugged VBOX_HARDDISK 2 +sys-devices-pci0000:00-0000:00:0d.0-ata3-ho… loaded active plugged VBOX_HARDDISK +sys-devices-platform-serial8250-tty-ttyS0.d… loaded active plugged /sys/devices/platform/serial8250/tty/ttyS0 +sys-devices-platform-serial8250-tty-ttyS1.d… loaded active plugged /sys/devices/platform/serial8250/tty/ttyS1 +sys-devices-platform-serial8250-tty-ttyS2.d… loaded active plugged /sys/devices/platform/serial8250/tty/ttyS2 +sys-devices-platform-serial8250-tty-ttyS3.d… loaded active plugged /sys/devices/platform/serial8250/tty/ttyS3 +sys-devices-virtual-misc-rfkill.device loaded active plugged /sys/devices/virtual/misc/rfkill +sys-module-configfs.device loaded active plugged /sys/module/configfs +sys-module-fuse.device loaded active plugged /sys/module/fuse +sys-subsystem-net-devices-enp0s3.device loaded active plugged 82540EM Gigabit Ethernet Controller (PRO/10… +sys-subsystem-net-devices-enp0s8.device loaded active plugged 82540EM Gigabit Ethernet Controller (PRO/10… +-.mount loaded active mounted Root Mount +boot.mount not-found inactive dead boot.mount +dev-hugepages.mount loaded active mounted Huge Pages File System +dev-mqueue.mount loaded active mounted POSIX Message Queue File System +home.mount not-found inactive dead home.mount +proc-fs-nfsd.mount loaded inactive dead NFSD configuration filesystem +proc-sys-fs-binfmt_misc.mount loaded inactive dead Arbitrary Executable File Formats File Syst… +run-credentials-systemd\x2dsysctl.service.m… loaded active mounted /run/credentials/systemd-sysctl.service +run-credentials-systemd\x2dtmpfiles\x2dsetu… loaded active mounted /run/credentials/systemd-tmpfiles-setup.ser… +run-credentials-systemd\x2dtmpfiles\x2dsetu… loaded active mounted /run/credentials/systemd-tmpfiles-setup-dev… +run-user-0.mount loaded active mounted /run/user/0 +sys-fs-fuse-connections.mount loaded active mounted FUSE Control File System +sys-kernel-config.mount loaded active mounted Kernel Configuration File System +sys-kernel-debug.mount loaded active mounted Kernel Debug File System +sys-kernel-tracing.mount loaded active mounted Kernel Trace File System +sysroot.mount not-found inactive dead sysroot.mount +tmp.mount loaded inactive dead Temporary Directory /tmp +vagrant.mount loaded failed failed /vagrant +var-lib-nfs-rpc_pipefs.mount loaded active mounted RPC Pipe File System +systemd-ask-password-console.path loaded active waiting Dispatch Password Requests to Console Direc… +systemd-ask-password-wall.path loaded active waiting Forward Password Requests to Wall Directory… +init.scope loaded active running System and Service Manager +session-3.scope loaded active running Session 3 of User root +auditd.service loaded active running Security Auditing Service +auth-rpcgss-module.service loaded inactive dead Kernel Module supporting RPCSEC_GSS +autofs.service not-found inactive dead autofs.service +cbd.service loaded active running Centreon Broker watchdog +centengine.service loaded inactive dead Centreon Engine +centreon.service loaded active exited One Service to rule them all. +centreontrapd.service loaded active running Centreon Trapd Daemon is a Centreon program… +chronyd.service loaded active running NTP client/server +crond.service loaded active running Command Scheduler +dbus-broker.service loaded active running D-Bus System Message Bus +display-manager.service not-found inactive dead display-manager.service +dnf-makecache.service loaded inactive dead dnf makecache +dracut-cmdline.service loaded inactive dead dracut cmdline hook +dracut-initqueue.service loaded inactive dead dracut initqueue hook +dracut-mount.service loaded inactive dead dracut mount hook +dracut-pre-mount.service loaded inactive dead dracut pre-mount hook +dracut-pre-pivot.service loaded inactive dead dracut pre-pivot and cleanup hook +dracut-pre-trigger.service loaded inactive dead dracut pre-trigger hook +dracut-pre-udev.service loaded inactive dead dracut pre-udev hook +dracut-shutdown-onfailure.service loaded inactive dead Service executing upon dracut-shutdown fail… +dracut-shutdown.service loaded active exited Restore /run/initramfs on shutdown +emergency.service loaded inactive dead Emergency Shell +getty@tty1.service loaded active running Getty on tty1 +gorgoned.service loaded active running Centreon Gorgone +gssproxy.service loaded active running GSSAPI Proxy Daemon +httpd-init.service not-found inactive dead httpd-init.service +httpd.service loaded active running The Apache HTTP Server +import-state.service loaded active exited Import network configuration from initramfs +initrd-cleanup.service loaded inactive dead Cleaning Up and Shutting Down Daemons +initrd-parse-etc.service loaded inactive dead Mountpoints Configured in the Real Root +initrd-switch-root.service loaded inactive dead Switch Root +initrd-udevadm-cleanup-db.service loaded inactive dead Cleanup udev Database +irqbalance.service loaded active running irqbalance daemon +kdump.service loaded active exited Crash recovery kernel arming +kmod-static-nodes.service loaded active exited Create List of Static Device Nodes +ldconfig.service loaded inactive dead Rebuild Dynamic Linker Cache +loadmodules.service loaded inactive dead Load legacy module configuration +logrotate.service loaded failed failed Rotate log files +mariadb.service loaded active running MariaDB 10.5.24 database server +microcode.service loaded inactive dead Load CPU microcode update +modprobe@configfs.service loaded inactive dead Load Kernel Module configfs +modprobe@drm.service loaded inactive dead Load Kernel Module drm +modprobe@fuse.service loaded inactive dead Load Kernel Module fuse +network.service not-found inactive dead network.service +NetworkManager-wait-online.service loaded active exited Network Manager Wait Online +NetworkManager.service loaded active running Network Manager +nfs-idmapd.service loaded inactive dead NFSv4 ID-name mapping service +nfs-mountd.service loaded inactive dead NFS Mount Daemon +nfs-server.service loaded inactive dead NFS server and services +nfs-utils.service loaded inactive dead NFS server and client services +nfsdcld.service loaded inactive dead NFSv4 Client Tracking Daemon +nis-domainname.service loaded active exited Read and set NIS domainname from /etc/sysco… +ntpd.service not-found inactive dead ntpd.service +ntpdate.service not-found inactive dead ntpdate.service +php-fpm.service loaded active running The PHP FastCGI Process Manager +plymouth-quit-wait.service not-found inactive dead plymouth-quit-wait.service +plymouth-start.service not-found inactive dead plymouth-start.service +rc-local.service loaded inactive dead /etc/rc.d/rc.local Compatibility +rescue.service loaded inactive dead Rescue Shell +rpc-gssd.service loaded inactive dead RPC security service for NFS client and ser… +rpc-statd-notify.service loaded active exited Notify NFS peers of a restart +rpc-statd.service loaded inactive dead NFS status monitor for NFSv2/3 locking. +rpc-svcgssd.service not-found inactive dead rpc-svcgssd.service +rpcbind.service loaded active running RPC Bind +rsyslog.service loaded active running System Logging Service +selinux-autorelabel-mark.service loaded inactive dead Mark the need to relabel after reboot +snmpd.service loaded active running Simple Network Management Protocol (SNMP) D… +snmptrapd.service loaded active running Simple Network Management Protocol (SNMP) T… +sntp.service not-found inactive dead sntp.service +sshd-keygen@ecdsa.service loaded inactive dead OpenSSH ecdsa Server Key Generation +sshd-keygen@ed25519.service loaded inactive dead OpenSSH ed25519 Server Key Generation +sshd-keygen@rsa.service loaded inactive dead OpenSSH rsa Server Key Generation +sshd.service loaded active running OpenSSH server daemon +sssd-kcm.service loaded inactive dead SSSD Kerberos Cache Manager +sssd.service loaded inactive dead System Security Services Daemon +syslog.service not-found inactive dead syslog.service +systemd-ask-password-console.service loaded inactive dead Dispatch Password Requests to Console +systemd-ask-password-wall.service loaded inactive dead Forward Password Requests to Wall +systemd-binfmt.service loaded inactive dead Set Up Additional Binary Formats +systemd-boot-system-token.service loaded inactive dead Store a System Token in an EFI Variable +systemd-firstboot.service loaded inactive dead First Boot Wizard +systemd-fsck-root.service loaded inactive dead File System Check on Root Device +systemd-hwdb-update.service loaded inactive dead Rebuild Hardware Database +systemd-initctl.service loaded inactive dead initctl Compatibility Daemon +systemd-journal-catalog-update.service loaded inactive dead Rebuild Journal Catalog +systemd-journal-flush.service loaded active exited Flush Journal to Persistent Storage +systemd-journald.service loaded active running Journal Service +systemd-logind.service loaded active running User Login Management +systemd-machine-id-commit.service loaded inactive dead Commit a transient machine-id on disk +systemd-modules-load.service loaded inactive dead Load Kernel Modules +systemd-network-generator.service loaded active exited Generate network units from Kernel command … +systemd-pcrphase-initrd.service loaded inactive dead TPM2 PCR Barrier (initrd) +systemd-pcrphase-sysinit.service loaded inactive dead TPM2 PCR Barrier (Initialization) +systemd-pcrphase.service loaded inactive dead TPM2 PCR Barrier (User) +systemd-random-seed.service loaded active exited Load/Save Random Seed +systemd-remount-fs.service loaded active exited Remount Root and Kernel File Systems +systemd-repart.service loaded inactive dead Repartition Root Disk +systemd-rfkill.service loaded inactive dead Load/Save RF Kill Switch Status +systemd-sysctl.service loaded active exited Apply Kernel Variables +systemd-sysext.service loaded inactive dead Merge System Extension Images into /usr/ an… +systemd-sysusers.service loaded inactive dead Create System Users +systemd-timesyncd.service not-found inactive dead systemd-timesyncd.service +systemd-tmpfiles-clean.service loaded inactive dead Cleanup of Temporary Directories +systemd-tmpfiles-setup-dev.service loaded active exited Create Static Device Nodes in /dev +systemd-tmpfiles-setup.service loaded active exited Create Volatile Files and Directories +systemd-tmpfiles.service not-found inactive dead systemd-tmpfiles.service +systemd-udev-settle.service loaded inactive dead Wait for udev To Complete Device Initializa… +systemd-udev-trigger.service loaded active exited Coldplug All udev Devices +systemd-udevd.service loaded active running Rule-based Manager for Device Events and Fi… +systemd-update-done.service loaded inactive dead Update is Completed +systemd-update-utmp-runlevel.service loaded inactive dead Record Runlevel Change in UTMP +systemd-update-utmp.service loaded active exited Record System Boot/Shutdown in UTMP +systemd-user-sessions.service loaded active exited Permit User Sessions +systemd-vconsole-setup.service loaded inactive dead Setup Virtual Console +user-runtime-dir@0.service loaded active exited User Runtime Directory /run/user/0 +user@0.service loaded active running User Manager for UID 0 +vboxadd-service.service loaded failed failed vboxadd-service.service +vboxadd.service loaded failed failed vboxadd.service +ypbind.service not-found inactive dead ypbind.service +yppasswdd.service not-found inactive dead yppasswdd.service +ypserv.service not-found inactive dead ypserv.service +ypxfrd.service not-found inactive dead ypxfrd.service +-.slice loaded active active Root Slice +system-getty.slice loaded active active Slice /system/getty +system-modprobe.slice loaded active active Slice /system/modprobe +system-sshd\x2dkeygen.slice loaded active active Slice /system/sshd-keygen +system.slice loaded active active System Slice +user-0.slice loaded active active User Slice of UID 0 +user.slice loaded active active User and Session Slice +dbus.socket loaded active running D-Bus System Message Bus Socket +rpcbind.socket loaded active running RPCbind Server Activation Socket +sssd-kcm.socket loaded active listening SSSD Kerberos Cache Manager responder socket +syslog.socket loaded inactive dead Syslog Socket +systemd-coredump.socket loaded active listening Process Core Dump Socket +systemd-initctl.socket loaded active listening initctl Compatibility Named Pipe +systemd-journald-dev-log.socket loaded active running Journal Socket (/dev/log) +systemd-journald.socket loaded active running Journal Socket +systemd-rfkill.socket loaded active listening Load/Save RF Kill Switch Status /dev/rfkill… +systemd-udevd-control.socket loaded active running udev Control Socket +systemd-udevd-kernel.socket loaded active running udev Kernel Socket +basic.target loaded active active Basic System +blockdev@dev-disk-by\x2duuid-04468d69\x2ddd… loaded inactive dead Block Device Preparation for /dev/disk/by-u… +cryptsetup-pre.target loaded inactive dead Local Encrypted Volumes (Pre) +cryptsetup.target loaded active active Local Encrypted Volumes +emergency.target loaded inactive dead Emergency Mode +first-boot-complete.target loaded inactive dead First Boot Complete +getty-pre.target loaded inactive dead Preparation for Logins +getty.target loaded active active Login Prompts +graphical.target loaded inactive dead Graphical Interface +initrd-fs.target loaded inactive dead Initrd File Systems +initrd-root-device.target loaded inactive dead Initrd Root Device +initrd-root-fs.target loaded inactive dead Initrd Root File System +initrd-switch-root.target loaded inactive dead Switch Root +initrd-usr-fs.target loaded inactive dead Initrd /usr File System +initrd.target loaded inactive dead Initrd Default Target +integritysetup.target loaded active active Local Integrity Protected Volumes +local-fs-pre.target loaded active active Preparation for Local File Systems +local-fs.target loaded active active Local File Systems +multi-user.target loaded active active Multi-User System +network-online.target loaded active active Network is Online +network-pre.target loaded active active Preparation for Network +network.target loaded active active Network +nfs-client.target loaded active active NFS client services +nss-lookup.target loaded inactive dead Host and Network Name Lookups +nss-user-lookup.target loaded active active User and Group Name Lookups +paths.target loaded active active Path Units +remote-cryptsetup.target loaded inactive dead Remote Encrypted Volumes +remote-fs-pre.target loaded active active Preparation for Remote File Systems +remote-fs.target loaded inactive dead Remote File Systems +remote-veritysetup.target loaded inactive dead Remote Verity Protected Volumes +rescue.target loaded inactive dead Rescue Mode +rpc_pipefs.target loaded active active rpc_pipefs.target +rpcbind.target loaded active active RPC Port Mapper +shutdown.target loaded inactive dead System Shutdown +slices.target loaded active active Slice Units +sockets.target loaded active active Socket Units +sshd-keygen.target loaded active active sshd-keygen.target +swap.target loaded active active Swaps +sysinit.target loaded active active System Initialization +syslog.target not-found inactive dead syslog.target +time-set.target loaded inactive dead System Time Set +time-sync.target loaded inactive dead System Time Synchronized +timers.target loaded active active Timer Units +umount.target loaded inactive dead Unmount All Filesystems +veritysetup-pre.target loaded inactive dead Local Verity Protected Volumes (Pre) +veritysetup.target loaded active active Local Verity Protected Volumes +dnf-makecache.timer loaded active waiting dnf makecache --timer +logrotate.timer loaded active waiting Daily rotation of log files +systemd-tmpfiles-clean.timer loaded active waiting Daily Cleanup of Temporary Directories +EOF + ;; + *) + echo "Unknown option" + ;; +esac +