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.8.2
# Tue 27 Jan 2026 17:38:18 +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.8.2
Show output
Jan 27 17:38:23.352934 osdx systemd-journald[83446]: Runtime Journal (/run/log/journal/7f16b2c6785447ce99316296df636466) is 1.9M, max 13.8M, 11.8M free.
Jan 27 17:38:23.354134 osdx systemd-journald[83446]: Received client request to rotate journal, rotating.
Jan 27 17:38:23.354185 osdx systemd-journald[83446]: Vacuuming done, freed 0B of archived journals from /run/log/journal/7f16b2c6785447ce99316296df636466.
Jan 27 17:38:23.363179 osdx OSDxCLI[103601]: User 'admin' executed a new command: 'system journal clear'.
Jan 27 17:38:23.588043 osdx OSDxCLI[103601]: User 'admin' executed a new command: 'system coredump delete all'.
Jan 27 17:38:23.865621 osdx OSDxCLI[103601]: User 'admin' entered the configuration menu.
Jan 27 17:38:23.972517 osdx OSDxCLI[103601]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 advisor ADVISOR1'.
Jan 27 17:38:24.024137 osdx OSDxCLI[103601]: User 'admin' added a new cfg line: 'set system advisor ADVISOR1 test false'.
Jan 27 17:38:24.118727 osdx OSDxCLI[103601]: User 'admin' added a new cfg line: 'set system cli configuration logging global info'.
Jan 27 17:38:24.183652 osdx OSDxCLI[103601]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 advisor ADVISOR1'.
Jan 27 17:38:24.315649 osdx OSDxCLI[103601]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 address 10.215.200.50/24'.
Jan 27 17:38:24.373662 osdx OSDxCLI[103601]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 operational 1 command "show version"'.
Jan 27 17:38:24.530192 osdx OSDxCLI[103601]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 operational 2 command "license show"'.
Jan 27 17:38:24.653706 osdx OSDxCLI[103601]: User 'admin' added a new cfg line: 'show working'.
Jan 27 17:38:24.788780 osdx ubnt-cfgd[166514]: inactive
Jan 27 17:38:24.811626 osdx INFO[166522]: FRR daemons did not change
Jan 27 17:38:24.813461 osdx modulelauncher[1432]: + Received data: ['103601', 'osdx.utils.xos', 'set_console_log_level', 'info']
Jan 27 17:38:24.833643 osdx OSDxCLI[103601]: Signal 10 received
Jan 27 17:38:24.914143 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth0
Jan 27 17:38:24.960626 osdx WARNING[166616]: No supported link modes on interface eth0
Jan 27 17:38:24.962682 osdx modulelauncher[166616]: osdx.utils.xos cmd error: /sbin/ethtool -A eth0 autoneg on
Jan 27 17:38:24.962703 osdx modulelauncher[166616]: Command '/sbin/ethtool -A eth0 autoneg on' returned non-zero exit status 76.
Jan 27 17:38:24.964195 osdx modulelauncher[166616]: osdx.utils.xos cmd error: /sbin/ethtool -s eth0 autoneg on advertise Pause off Asym_Pause off --
Jan 27 17:38:24.964207 osdx modulelauncher[166616]: Command '/sbin/ethtool -s eth0 autoneg on advertise Pause off Asym_Pause off --' returned non-zero exit status 75.
Jan 27 17:38:24.980754 osdx cfgd[1623]: [103601]Completed change to active configuration
Jan 27 17:38:24.992430 osdx OSDxCLI[103601]: User 'admin' committed the configuration.
Jan 27 17:38:25.010223 osdx OSDxCLI[103601]: User 'admin' left the configuration menu.
Jan 27 17:38:25.198931 osdx OSDxCLI[103601]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
Jan 27 17:38:25.199435 osdx OSDxCLI[103601]: pam_unix(cli:session): session closed for user admin
Jan 27 17:38:25.199683 osdx OSDxCLI[103601]: User 'admin' entered the configuration menu.
Jan 27 17:38:25.266545 osdx OSDxCLI[103601]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
Jan 27 17:38:25.266778 osdx cfgd[1623]: Execute action [syntax] for node [system advisor ADVISOR1]
Jan 27 17:38:25.267136 osdx OSDxCLI[103601]: pam_unix(cli:session): session closed for user admin
Jan 27 17:38:25.267417 osdx OSDxCLI[103601]: User 'admin' added a new cfg line: 'set system advisor ADVISOR1 test true'.
Jan 27 17:38:25.362929 osdx OSDxCLI[103601]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
Jan 27 17:38:25.368212 osdx OSDxCLI[103601]: pam_unix(cli:session): session closed for user admin
Jan 27 17:38:25.368434 osdx OSDxCLI[103601]: User 'admin' added a new cfg line: 'show changes'.
Jan 27 17:38:25.428701 osdx OSDxCLI[103601]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
Jan 27 17:38:25.437035 osdx ubnt-cfgd[166666]: inactive
Jan 27 17:38:25.523634 osdx cfgd[1623]: [103601]must validation for [system login user admin role] was skipped
Jan 27 17:38:25.523649 osdx cfgd[1623]: Execute action [commit-subtree] for node [system advisor ADVISOR1]
Jan 27 17:38:25.532118 osdx INFO[166674]: FRR daemons did not change
Jan 27 17:38:25.532335 osdx cfgd[1623]: Execute action [end] for node [system advisor ADVISOR1]
Jan 27 17:38:25.538816 osdx cfgd[1623]: [103601]Completed change to active configuration
Jan 27 17:38:25.541037 osdx OSDxCLI[103601]: pam_unix(cli:session): session closed for user admin
Jan 27 17:38:25.541389 osdx OSDxCLI[103601]: User 'admin' committed the configuration.
Jan 27 17:38:25.542851 osdx INFO[166682]: SCRIPT SCRIPT_1 operations:
Jan 27 17:38:25.548122 osdx OSDxCLI[166689]: Tecla::GetLine tcgetattr error
Jan 27 17:38:25.548126 osdx OSDxCLI[166689]: User 'admin' has logged in.
Jan 27 17:38:25.559966 osdx OSDxCLI[166689]: User 'admin' executed a new command: 'show version'.
Jan 27 17:38:25.560919 osdx OSDxCLI[103601]: User 'admin' left the configuration menu.
Jan 27 17:38:25.561562 osdx OSDxCLI[166689]: User 'admin' has logged out.
Jan 27 17:38:25.561584 osdx OSDxCLI[166689]: Tecla::GetLine tcgetattr error
Jan 27 17:38:25.562329 osdx INFO[166682]: Operation 1 'show version
                                          ':

                                            OS vendor:                 Teldat
                                            OS name:                   OSDx
                                            OS version:                v4.2.8.2
                                            OS Linux kernel:           6.1.158
                                            OS built by:               jenkins@daphne
                                            OS build date:             Tue Jan 27 09:39:40 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:             eec87907-b450-5f15-8bc0-f07b3413ab35
                                            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 27 Jan 2026 17:38:25 +00:00
                                            Uptime:                    1:19:24
                                            CPU load (1m, 5m, 15m):    0.45 0.35 0.25
                                            CPU usage % (1m):          4.80
                                            Storage usage (kB):        397076/8144384
                                            Memory usage (kB):         414164/1570500
                                            Users logged in:           1
                                            Mode (current/next boot):  user/user

                                            Hostname:                  osdx
Jan 27 17:38:25.567446 osdx OSDxCLI[166696]: Tecla::GetLine tcgetattr error
Jan 27 17:38:25.567452 osdx OSDxCLI[166696]: User 'admin' has logged in.
Jan 27 17:38:25.571498 osdx OSDxCLI[166696]: Tecla::GetLine tcgetattr error
Jan 27 17:38:25.573941 osdx OSDxCLI[166696]: Tecla::GetLine tcgetattr error
Jan 27 17:38:25.574096 osdx OSDxCLI[166696]: User 'admin' executed a new command: 'license show'.
Jan 27 17:38:25.574976 osdx OSDxCLI[166696]: User 'admin' has logged out.
Jan 27 17:38:25.574980 osdx OSDxCLI[166696]: Tecla::GetLine tcgetattr error
Jan 27 17:38:25.575502 osdx INFO[166682]: 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  |
                                          +-----------------+----------+----------+
Jan 27 17:38:25.756152 osdx OSDxCLI[103601]: 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::e00a:adff:fe9e:4d9b/64  up     up
dum1  fe80::c08b:b1ff:fe7c:64c9/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.8.2
# Tue 27 Jan 2026 17:38:38 +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.8.2
# Tue 27 Jan 2026 17:38:39 +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.8.2
# Tue 27 Jan 2026 17:38:40 +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]