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.3
# Tue 05 May 2026 02:48:41 +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.3
Show output
May 05 02:48:45.284034 osdx systemd-journald[1908]: Runtime Journal (/run/log/journal/9e2a66651dea45ed982d8152051049c2) is 1.8M, max 13.8M, 11.9M free.
May 05 02:48:45.287210 osdx systemd-journald[1908]: Received client request to rotate journal, rotating.
May 05 02:48:45.287252 osdx systemd-journald[1908]: Vacuuming done, freed 0B of archived journals from /run/log/journal/9e2a66651dea45ed982d8152051049c2.
May 05 02:48:45.293103 osdx OSDxCLI[598646]: User 'admin' executed a new command: 'system journal clear'.
May 05 02:48:45.487794 osdx OSDxCLI[598646]: User 'admin' executed a new command: 'system coredump delete all'.
May 05 02:48:45.695738 osdx OSDxCLI[598646]: User 'admin' entered the configuration menu.
May 05 02:48:45.749783 osdx OSDxCLI[598646]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 advisor ADVISOR1'.
May 05 02:48:45.843551 osdx OSDxCLI[598646]: User 'admin' added a new cfg line: 'set system advisor ADVISOR1 test false'.
May 05 02:48:45.897168 osdx OSDxCLI[598646]: User 'admin' added a new cfg line: 'set system cli configuration logging global info'.
May 05 02:48:45.992217 osdx OSDxCLI[598646]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 advisor ADVISOR1'.
May 05 02:48:46.068849 osdx OSDxCLI[598646]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 address 10.215.200.50/24'.
May 05 02:48:46.139049 osdx OSDxCLI[598646]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 operational 1 command "show version"'.
May 05 02:48:46.191927 osdx OSDxCLI[598646]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 operational 2 command "license show"'.
May 05 02:48:46.293654 osdx OSDxCLI[598646]: User 'admin' added a new cfg line: 'show working'.
May 05 02:48:46.350039 osdx ubnt-cfgd[692939]: inactive
May 05 02:48:46.369141 osdx INFO[692947]: FRR daemons did not change
May 05 02:48:46.370668 osdx modulelauncher[1456]: + Received data: ['598646', 'osdx.utils.xos', 'set_console_log_level', 'info']
May 05 02:48:46.387751 osdx OSDxCLI[598646]: Signal 10 received
May 05 02:48:46.447219 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth0
May 05 02:48:46.490746 osdx WARNING[693041]: No supported link modes on interface eth0
May 05 02:48:46.492092 osdx modulelauncher[693041]: osdx.utils.xos cmd error: /sbin/ethtool -A eth0 autoneg on
May 05 02:48:46.492103 osdx modulelauncher[693041]: Command '/sbin/ethtool -A eth0 autoneg on' returned non-zero exit status 76.
May 05 02:48:46.493209 osdx modulelauncher[693041]: osdx.utils.xos cmd error: /sbin/ethtool -s eth0 autoneg on advertise Pause off Asym_Pause off --
May 05 02:48:46.493216 osdx modulelauncher[693041]: Command '/sbin/ethtool -s eth0 autoneg on advertise Pause off Asym_Pause off --' returned non-zero exit status 75.
May 05 02:48:46.502968 osdx cfgd[1648]: [598646]Completed change to active configuration
May 05 02:48:46.516962 osdx OSDxCLI[598646]: User 'admin' committed the configuration.
May 05 02:48:46.535983 osdx OSDxCLI[598646]: User 'admin' left the configuration menu.
May 05 02:48:46.737082 osdx OSDxCLI[598646]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
May 05 02:48:46.737572 osdx OSDxCLI[598646]: pam_unix(cli:session): session closed for user admin
May 05 02:48:46.737815 osdx OSDxCLI[598646]: User 'admin' entered the configuration menu.
May 05 02:48:46.792008 osdx OSDxCLI[598646]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
May 05 02:48:46.792204 osdx cfgd[1648]: Execute action [syntax] for node [system advisor ADVISOR1]
May 05 02:48:46.792493 osdx OSDxCLI[598646]: pam_unix(cli:session): session closed for user admin
May 05 02:48:46.792670 osdx OSDxCLI[598646]: User 'admin' added a new cfg line: 'set system advisor ADVISOR1 test true'.
May 05 02:48:46.885301 osdx OSDxCLI[598646]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
May 05 02:48:46.890334 osdx OSDxCLI[598646]: pam_unix(cli:session): session closed for user admin
May 05 02:48:46.890514 osdx OSDxCLI[598646]: User 'admin' added a new cfg line: 'show changes'.
May 05 02:48:46.936501 osdx OSDxCLI[598646]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
May 05 02:48:46.944463 osdx ubnt-cfgd[693092]: inactive
May 05 02:48:46.970616 osdx cfgd[1648]: [598646]must validation for [system login user admin role] was skipped
May 05 02:48:46.970629 osdx cfgd[1648]: Execute action [commit-subtree] for node [system advisor ADVISOR1]
May 05 02:48:46.977040 osdx INFO[693100]: FRR daemons did not change
May 05 02:48:46.977177 osdx cfgd[1648]: Execute action [end] for node [system advisor ADVISOR1]
May 05 02:48:46.983693 osdx cfgd[1648]: [598646]Completed change to active configuration
May 05 02:48:46.985487 osdx OSDxCLI[598646]: pam_unix(cli:session): session closed for user admin
May 05 02:48:46.985748 osdx OSDxCLI[598646]: User 'admin' committed the configuration.
May 05 02:48:46.987064 osdx INFO[693108]: SCRIPT SCRIPT_1 operations:
May 05 02:48:46.992049 osdx OSDxCLI[693116]: Tecla::GetLine tcgetattr error
May 05 02:48:46.992055 osdx OSDxCLI[693116]: User 'admin' has logged in.
May 05 02:48:47.000206 osdx OSDxCLI[598646]: User 'admin' left the configuration menu.
May 05 02:48:47.002597 osdx OSDxCLI[693116]: User 'admin' executed a new command: 'show version'.
May 05 02:48:47.003471 osdx OSDxCLI[693116]: User 'admin' has logged out.
May 05 02:48:47.003476 osdx OSDxCLI[693116]: Tecla::GetLine tcgetattr error
May 05 02:48:47.004041 osdx INFO[693108]: Operation 1 'show version
                                          ':

                                            OS vendor:                 Teldat
                                            OS name:                   OSDx
                                            OS version:                v4.2.9.3
                                            OS Linux kernel:           6.12.74
                                            OS built by:               jenkins@diana
                                            OS build date:             Mon May 4 07:22:04 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:             2d377ee9-e07c-52e8-820a-5f99c944420e
                                            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:        Panic

                                            Date:                      Tue 05 May 2026 02:48:46 +00:00
                                            Uptime:                    5:30:51
                                            CPU load (1m, 5m, 15m):    0.22 0.18 0.16
                                            CPU usage % (1m):          4.68
                                            Storage usage (kB):        420260/8144384
                                            Memory usage (kB):         468108/1572692
                                            Users logged in:           1
                                            Mode (current/next boot):  user/user

                                            Hostname:                  osdx
May 05 02:48:47.008355 osdx OSDxCLI[693122]: Tecla::GetLine tcgetattr error
May 05 02:48:47.008360 osdx OSDxCLI[693122]: User 'admin' has logged in.
May 05 02:48:47.010570 osdx OSDxCLI[693122]: Tecla::GetLine tcgetattr error
May 05 02:48:47.012493 osdx OSDxCLI[693122]: Tecla::GetLine tcgetattr error
May 05 02:48:47.012666 osdx OSDxCLI[693122]: User 'admin' executed a new command: 'license show'.
May 05 02:48:47.013469 osdx OSDxCLI[693122]: User 'admin' has logged out.
May 05 02:48:47.013474 osdx OSDxCLI[693122]: Tecla::GetLine tcgetattr error
May 05 02:48:47.014023 osdx INFO[693108]: 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  |
                                          +-----------------+----------+----------+
May 05 02:48:47.124511 osdx OSDxCLI[598646]: 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::6446:d3ff:fee3:ae03/64  up     up
dum1  fe80::54a9:c5ff:febf:8ced/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.3
# Tue 05 May 2026 02:48:58 +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.3
# Tue 05 May 2026 02:48:59 +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.3
# Tue 05 May 2026 02:49:00 +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]