Script

Test to check advisor scripts

Configuration Script

Description

In this scenario, an advisor is triggered to activate the automatic script. When the advisor is changed to true, the automatic script associated with the advisor is executed, aplying the commands in the active configuration.

Scenario

Step 1: Set the following configuration in DUT0 :

set system advisor ADVISOR1 test false
set system cli configuration logging global info
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system script SCRIPT_1 advisor ADVISOR1
set system script SCRIPT_1 configuration 'set system description \'advisor applied\''

Step 2: Modify the following configuration lines in DUT0 :

set system advisor ADVISOR1 test true

Step 3: Run command show running at DUT0 and check if output contains the following tokens:

set system description 'advisor applied'
Show output
# Teldat OSDx VM version v4.2.9.4
# Thu 04 Jun 2026 12:03:57 +00:00
# Warning: Configuration has not been saved
set system advisor ADVISOR1 test true
set system cli configuration logging global info
set system description 'advisor applied'
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system script SCRIPT_1 advisor ADVISOR1
set system script SCRIPT_1 configuration 'set system description \'advisor applied\''

Operational Script

Description

In this scenario, an advisor is triggered to activate the automatic script. When the advisor is changed to true, the automatic script associated with the advisor is executed, proccessing the operational commands in the specified order.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.215.200.50/24
set system advisor ADVISOR1 test false
set system cli configuration logging global info
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system script SCRIPT_1 advisor ADVISOR1
set system script SCRIPT_1 operational 1 command 'show version'
set system script SCRIPT_1 operational 2 command 'license show'

Step 2: Modify the following configuration lines in DUT0 :

set system advisor ADVISOR1 test true

Step 3: Run command system journal show | cat at DUT0 and check if output contains the following tokens:

v4.2.9.4
Show output
Jun 04 12:04:01.284783 osdx systemd-journald[172397]: Runtime Journal (/run/log/journal/d7b8b58d13984d0bb9acdb87ea6c32f4) is 1.8M, max 13.8M, 11.9M free.
Jun 04 12:04:01.288138 osdx systemd-journald[172397]: Received client request to rotate journal, rotating.
Jun 04 12:04:01.288200 osdx systemd-journald[172397]: Vacuuming done, freed 0B of archived journals from /run/log/journal/d7b8b58d13984d0bb9acdb87ea6c32f4.
Jun 04 12:04:01.295995 osdx OSDxCLI[172235]: User 'admin' executed a new command: 'system journal clear'.
Jun 04 12:04:01.505501 osdx OSDxCLI[172235]: User 'admin' executed a new command: 'system coredump delete all'.
Jun 04 12:04:01.713978 osdx OSDxCLI[172235]: User 'admin' entered the configuration menu.
Jun 04 12:04:01.859061 osdx OSDxCLI[172235]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 advisor ADVISOR1'.
Jun 04 12:04:01.930667 osdx OSDxCLI[172235]: User 'admin' added a new cfg line: 'set system advisor ADVISOR1 test false'.
Jun 04 12:04:02.030364 osdx OSDxCLI[172235]: User 'admin' added a new cfg line: 'set system cli configuration logging global info'.
Jun 04 12:04:02.090362 osdx OSDxCLI[172235]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 advisor ADVISOR1'.
Jun 04 12:04:02.248471 osdx OSDxCLI[172235]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 address 10.215.200.50/24'.
Jun 04 12:04:02.345096 osdx OSDxCLI[172235]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 operational 1 command "show version"'.
Jun 04 12:04:02.452551 osdx OSDxCLI[172235]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 operational 2 command "license show"'.
Jun 04 12:04:02.575799 osdx OSDxCLI[172235]: User 'admin' added a new cfg line: 'show working'.
Jun 04 12:04:02.641807 osdx ubnt-cfgd[179466]: inactive
Jun 04 12:04:02.669470 osdx INFO[179474]: FRR daemons did not change
Jun 04 12:04:02.671516 osdx modulelauncher[1656]: + Received data: ['172235', 'osdx.utils.xos', 'set_console_log_level', 'info']
Jun 04 12:04:02.691673 osdx OSDxCLI[172235]: Signal 10 received
Jun 04 12:04:02.764045 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth0
Jun 04 12:04:02.812786 osdx WARNING[179568]: No supported link modes on interface eth0
Jun 04 12:04:02.814210 osdx modulelauncher[179568]: osdx.utils.xos cmd error: /sbin/ethtool -A eth0 autoneg on
Jun 04 12:04:02.814223 osdx modulelauncher[179568]: Command '/sbin/ethtool -A eth0 autoneg on' returned non-zero exit status 76.
Jun 04 12:04:02.815421 osdx modulelauncher[179568]: osdx.utils.xos cmd error: /sbin/ethtool -s eth0 autoneg on advertise Asym_Pause off Pause off --
Jun 04 12:04:02.815430 osdx modulelauncher[179568]: Command '/sbin/ethtool -s eth0 autoneg on advertise Asym_Pause off Pause off --' returned non-zero exit status 75.
Jun 04 12:04:02.827539 osdx cfgd[1850]: [172235]Completed change to active configuration
Jun 04 12:04:02.841223 osdx OSDxCLI[172235]: User 'admin' committed the configuration.
Jun 04 12:04:02.863032 osdx OSDxCLI[172235]: User 'admin' left the configuration menu.
Jun 04 12:04:03.064413 osdx OSDxCLI[172235]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
Jun 04 12:04:03.064903 osdx OSDxCLI[172235]: pam_unix(cli:session): session closed for user admin
Jun 04 12:04:03.065141 osdx OSDxCLI[172235]: User 'admin' entered the configuration menu.
Jun 04 12:04:03.145739 osdx OSDxCLI[172235]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
Jun 04 12:04:03.146066 osdx cfgd[1850]: Execute action [syntax] for node [system advisor ADVISOR1]
Jun 04 12:04:03.146575 osdx OSDxCLI[172235]: pam_unix(cli:session): session closed for user admin
Jun 04 12:04:03.146875 osdx OSDxCLI[172235]: User 'admin' added a new cfg line: 'set system advisor ADVISOR1 test true'.
Jun 04 12:04:03.200857 osdx OSDxCLI[172235]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
Jun 04 12:04:03.207146 osdx OSDxCLI[172235]: pam_unix(cli:session): session closed for user admin
Jun 04 12:04:03.207434 osdx OSDxCLI[172235]: User 'admin' added a new cfg line: 'show changes'.
Jun 04 12:04:03.293041 osdx OSDxCLI[172235]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
Jun 04 12:04:03.302303 osdx ubnt-cfgd[179619]: inactive
Jun 04 12:04:03.368278 osdx cfgd[1850]: [172235]must validation for [system login user admin role] was skipped
Jun 04 12:04:03.368294 osdx cfgd[1850]: Execute action [commit-subtree] for node [system advisor ADVISOR1]
Jun 04 12:04:03.375676 osdx INFO[179627]: FRR daemons did not change
Jun 04 12:04:03.375865 osdx cfgd[1850]: Execute action [end] for node [system advisor ADVISOR1]
Jun 04 12:04:03.381726 osdx cfgd[1850]: [172235]Completed change to active configuration
Jun 04 12:04:03.384073 osdx OSDxCLI[172235]: pam_unix(cli:session): session closed for user admin
Jun 04 12:04:03.384408 osdx OSDxCLI[172235]: User 'admin' committed the configuration.
Jun 04 12:04:03.385925 osdx INFO[179635]: SCRIPT SCRIPT_1 operations:
Jun 04 12:04:03.407593 osdx OSDxCLI[179642]: Tecla::GetLine tcgetattr error
Jun 04 12:04:03.407603 osdx OSDxCLI[179642]: User 'admin' has logged in.
Jun 04 12:04:03.412300 osdx OSDxCLI[172235]: User 'admin' left the configuration menu.
Jun 04 12:04:03.418910 osdx OSDxCLI[179642]: User 'admin' executed a new command: 'show version'.
Jun 04 12:04:03.419961 osdx OSDxCLI[179642]: User 'admin' has logged out.
Jun 04 12:04:03.419968 osdx OSDxCLI[179642]: Tecla::GetLine tcgetattr error
Jun 04 12:04:03.420762 osdx INFO[179635]: Operation 1 'show version
                                          ':

                                            OS vendor:                 Teldat
                                            OS name:                   OSDx
                                            OS version:                v4.2.9.4
                                            OS Linux kernel:           6.12.90
                                            OS built by:               jenkins@diana
                                            OS build date:             Thu Jun 4 10:13:54 UTC 2026
                                            OS installation:           physical
                                            OS boot mode:              user
                                            License:                   VM_BASE Firewall eth-Rate-Permit-Full

                                            Hardware vendor:           QEMU
                                            Hardware model:            VM
                                            Hardware OEM model:        Standard PC (i440FX + PIIX, 1996)
                                            Hardware version:          pc-i440fx-7.2
                                            Hardware UUID:             666beca5-a32e-5548-9397-db6248fa0b86
                                            Hardware architecture:     amd64
                                            Hardware fwid:             iso
                                            Hardware base MAC:         de:ad:be:ef:6c:00
                                            Hardware cpu:              1 x QEMU Virtual CPU version 2.5+ (4 cores)

                                            Last reboot reason:        Power Failure

                                            Date:                      Thu 04 Jun 2026 12:04:03 +00:00
                                            Uptime:                    1:26:37
                                            CPU load (1m, 5m, 15m):    0.30 0.23 0.15
                                            CPU usage % (1m):          5.83
                                            Storage usage (kB):        418340/8144384
                                            Memory usage (kB):         410428/1572684
                                            Users logged in:           1
                                            Mode (current/next boot):  user/user

                                            Hostname:                  osdx
Jun 04 12:04:03.425976 osdx OSDxCLI[179649]: Tecla::GetLine tcgetattr error
Jun 04 12:04:03.425983 osdx OSDxCLI[179649]: User 'admin' has logged in.
Jun 04 12:04:03.429451 osdx OSDxCLI[179649]: Tecla::GetLine tcgetattr error
Jun 04 12:04:03.431727 osdx OSDxCLI[179649]: Tecla::GetLine tcgetattr error
Jun 04 12:04:03.431937 osdx OSDxCLI[179649]: User 'admin' executed a new command: 'license show'.
Jun 04 12:04:03.432915 osdx OSDxCLI[179649]: User 'admin' has logged out.
Jun 04 12:04:03.432920 osdx OSDxCLI[179649]: Tecla::GetLine tcgetattr error
Jun 04 12:04:03.433629 osdx INFO[179635]: Operation 2 'license show
                                          ':
                                          License: VM_BASE Firewall eth-Rate-Permit-Full

                                          +-----------------+----------+----------+
                                          | License Item    | Status   | Validity |
                                          +-----------------+----------+----------+
                                          | CELL            | Disabled | -        |
                                          | Firewall        | Enabled  | Forever  |
                                          | RD-ETSI         | Disabled | -        |
                                          | RD-FCC          | Disabled | -        |
                                          | RD-NOM          | Disabled | -        |
                                          | RD-ROW          | Disabled | -        |
                                          | WLAN            | Disabled | -        |
                                          | Windbit         | Disabled | -        |
                                          | eth-Rate-Permit | Full     | Forever  |
                                          +-----------------+----------+----------+
Jun 04 12:04:03.553492 osdx OSDxCLI[172235]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)

Simple Script Execution

Description

In this scenario, an automatic script is activated directly without any advisor triggering. The script is activated using the system script <txt> activate command.

Scenario

Step 1: Set the following configuration in DUT0 :

set system advisor ADVISOR1 test false
set system cli configuration logging global info
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system script SCRIPT_1 advisor ADVISOR1
set system script SCRIPT_1 configuration 'set interfaces dummy dum0'
set system script SCRIPT_1 configuration 'set interfaces dummy dum1'

Step 2: Run command system script SCRIPT_1 activate at DUT0.

Step 3: Run command interfaces dummy show at DUT0 and check if output matches the following regular expressions:

dum0.*\ndum1
Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
dum0  fe80::f496:80ff:fe6b:1639/64  up     up
dum1  fe80::dcaa:4eff:fe41:e8c4/64  up     up

Multiple Triggers Script

Description

In this scenario, an advisor is triggered multiple times to activate the automatic script. When the advisor is changed to true, the automatic script associated with the advisor is executed, proccessing the operational commands in the specified order.

Scenario

Step 1: Set the following configuration in DUT0 :

set system advisor ADVISOR1 test false
set system cli configuration logging global info
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system script SCRIPT_1 advisor ADVISOR1
set system script SCRIPT_1 configuration 'set system description \'advisor applied\''
set system script SCRIPT_1 number-of-triggers 3

Note

Wait for the advisor to turn on. After that, wait for the advisor to turn off. This produces only one trigger.

Step 2: Modify the following configuration lines in DUT0 :

set system advisor ADVISOR1 test true

Step 3: Modify the following configuration lines in DUT0 :

set system advisor ADVISOR1 test false

Step 4: Expect a failure in the following command: Run command show running at DUT0 and check if output contains the following tokens:

set system description 'advisor applied'
Show output
# Teldat OSDx VM version v4.2.9.4
# Thu 04 Jun 2026 12:04:17 +00:00
# Warning: Configuration has not been saved
set system advisor ADVISOR1 test false
set system cli configuration logging global info
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system script SCRIPT_1 advisor ADVISOR1
set system script SCRIPT_1 configuration 'set system description \'advisor applied\''
set system script SCRIPT_1 number-of-triggers 3

Note

Wait for the advisor to turn on. After that, wait for the advisor to turn off. This produces only one trigger.

Step 5: Modify the following configuration lines in DUT0 :

set system advisor ADVISOR1 test true

Step 6: Modify the following configuration lines in DUT0 :

set system advisor ADVISOR1 test false

Step 7: Expect a failure in the following command: Run command show running at DUT0 and check if output contains the following tokens:

set system description 'advisor applied'
Show output
# Teldat OSDx VM version v4.2.9.4
# Thu 04 Jun 2026 12:04:18 +00:00
# Warning: Configuration has not been saved
set system advisor ADVISOR1 test false
set system cli configuration logging global info
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system script SCRIPT_1 advisor ADVISOR1
set system script SCRIPT_1 configuration 'set system description \'advisor applied\''
set system script SCRIPT_1 number-of-triggers 3

Note

Wait for the advisor to turn on. After that, wait for the advisor to turn off. This produces only one trigger.

Step 8: Modify the following configuration lines in DUT0 :

set system advisor ADVISOR1 test true

Step 9: Modify the following configuration lines in DUT0 :

set system advisor ADVISOR1 test false

Step 10: Run command show running at DUT0 and check if output contains the following tokens:

set system description 'advisor applied'
Show output
# Teldat OSDx VM version v4.2.9.4
# Thu 04 Jun 2026 12:04:20 +00:00
# Warning: Configuration has not been saved
set system advisor ADVISOR1 test false
set system cli configuration logging global info
set system description 'advisor applied'
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system script SCRIPT_1 advisor ADVISOR1
set system script SCRIPT_1 configuration 'set system description \'advisor applied\''
set system script SCRIPT_1 number-of-triggers 3

Script Invalid Paths

Description

Test that checks invalid configurational and operational commands script execution on an advisor

Scenario

Step 1: Set the following configuration in DUT0 :

set system advisor ADVISOR1 test false
set system cli configuration logging global info
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system script SCRIPT_1 advisor ADVISOR1

Step 2: Expect a failure in the following command: Run command set system script SCRIPT_1 configuration 'set potato' at DUT0 and expect this output:

Show output
Value validation failed
CLI Error: Command error

Step 3: Set the following configuration in DUT0 :

set system advisor ADVISOR1 test false
set system cli configuration logging global info
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system script SCRIPT_1 advisor ADVISOR1
set system script SCRIPT_1 operational 1 command 'system potato'

Step 4: Run command system script SCRIPT_1 activate at DUT0 and expect this output: Step 5: Run command system journal show | grep "CLI Error: Invalid token *" at DUT0 and check if output contains the following tokens:

CLI Error: Invalid token [potato]
Show output
CLI Error: Invalid token [potato]