From e7a89a462a6b09b2a037f6e7d765421d5af81597 Mon Sep 17 00:00:00 2001 From: FrantiĊĦek Hrdina Date: Sep 12 2023 08:26:01 +0000 Subject: Fixing failing initscript test /Sanity/initscript Return values differs because some systemd things and polkit (not)installed. The main idea of test is, that the return values should not be zero, so 1 or 4 occuring is fine. --- diff --git a/Sanity/initscript/runtest.sh b/Sanity/initscript/runtest.sh index 9a6d07f..b672dec 100755 --- a/Sanity/initscript/runtest.sh +++ b/Sanity/initscript/runtest.sh @@ -79,14 +79,10 @@ rlJournalStart rlRun "systemctl --no-pager status frr" 3 "Status of stopped service" rlLog ">>>>>>>>> insufficient rights" - # Polkit rpm installed is causing that running with insufficient rights returns 1 instead of 4 - if (rlIsRHEL '>=9' || rlIsFedora || rlIsCentOS '>=9') && ! rlCheckRpm 'polkit'; then - ACCESS_DENIED_EXIT_STATUS=4 - else - ACCESS_DENIED_EXIT_STATUS=1 - fi + # Return values differs because some systemd things and polkit (not)installed. + # The main idea of test is, that the return values should not be zero, so 1 or 4 occuring is fine. rlRun "systemctl start frr " 0 " Starting service for restarting under nonpriv user " - rlRun "su testuserqa -c 'systemctl restart frr'" $ACCESS_DENIED_EXIT_STATUS "Insufficient rights, restarting service under nonprivileged user must fail" + rlRun "su testuserqa -c 'systemctl restart frr'" 1,4 "Insufficient rights, restarting service under nonprivileged user must fail" rlRun "systemctl stop frr " 0 rlLog ">>>>>>>>> operations"