Check Commit Validation

The following scenario shows how to configure the system to activate or deactivate previously defined alarms based on the results of executing the “commit” command.

Test Commit Validation

Description

In this scenario an alarm is configured in DUT0 to be activated or deactivated based on the results of executing the “commit” command. First, the alarm is activated when the “commit” command fails. Then the alarm is deactivated when the “commit” command is successful.

Scenario

Step 1: Set the following configuration in DUT0:

set system configuration commit alarm ALARM_COMMIT
set system alarm ALARM_COMMIT

Step 2: Run command system alarm ALARM_COMMIT show at DUT0 and check if output matches the following regular expressions:

(ALARM_COMMIT)\s+(false)
Show output
----------------------------------------------------------------------
   Alarm      Status  Toggled  Prev-toggled  Toggle-count  Time up (%)
----------------------------------------------------------------------
ALARM_COMMIT  false                                     0         0.00

Note

The output of the above command should show that the alarm was created successfully and is currently deactivated, since the last executed “commit” was successful.

Step 3: Expect a failure in the following command: Set the following configuration in DUT0:

set interfaces ethernet eth0 address 10.0.0.1/24
set interfaces ethernet eth0 alarm down ALARM_TO_TEST

Note

In the above command, the “commit” should fail as it is trying to adjust a wrong configuration.

Step 4: Run command system alarm ALARM_COMMIT show at DUT0 and check if output matches the following regular expressions:

(ALARM_COMMIT)\s+(true)
Show output
-----------------------------------------------------------------------------------------
   Alarm      Status           Toggled            Prev-toggled  Toggle-count  Time up (%)
-----------------------------------------------------------------------------------------
ALARM_COMMIT  true    2023-11-23 23:35:01.862799                           1        21.82

Note

The output of the above command should show that the alarm is activated, since the last executed “commit” failed.

Step 5: Set the following configuration in DUT0:

set interfaces ethernet eth0 address 10.0.0.1/24
set interfaces ethernet eth0 alarm down ALARM_TO_TEST
set system alarm ALARM_TO_TEST

Note

In the above command, the “commit” should be successful as it is trying to adjust a correct configuration.

Step 6: Run command system alarm ALARM_COMMIT show at DUT0 and check if output matches the following regular expressions:

(ALARM_COMMIT)\s+(false)
Show output
-------------------------------------------------------------------------------------------------------
   Alarm      Status           Toggled                   Prev-toggled         Toggle-count  Time up (%)
-------------------------------------------------------------------------------------------------------
ALARM_COMMIT  false   2023-11-23 23:35:02.823026  2023-11-23 23:35:01.862799             2        51.04

Note

The output of the above command should show that the alarm is deactivated, since the last executed “commit” was successful.