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.3
# Thu 12 Feb 2026 23:21:02 +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.3
Show output
Feb 12 23:21:07.305384 osdx systemd-journald[681778]: Runtime Journal (/run/log/journal/fef7273cfed74888920ec39438478308) is 2.4M, max 17.2M, 14.8M free.
Feb 12 23:21:07.308067 osdx systemd-journald[681778]: Received client request to rotate journal, rotating.
Feb 12 23:21:07.308129 osdx systemd-journald[681778]: Vacuuming done, freed 0B of archived journals from /run/log/journal/fef7273cfed74888920ec39438478308.
Feb 12 23:21:07.315149 osdx OSDxCLI[781896]: User 'admin' executed a new command: 'system journal clear'.
Feb 12 23:21:07.546060 osdx OSDxCLI[781896]: User 'admin' executed a new command: 'system coredump delete all'.
Feb 12 23:21:07.828415 osdx OSDxCLI[781896]: User 'admin' entered the configuration menu.
Feb 12 23:21:07.890983 osdx OSDxCLI[781896]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 advisor ADVISOR1'.
Feb 12 23:21:07.987147 osdx OSDxCLI[781896]: User 'admin' added a new cfg line: 'set system advisor ADVISOR1 test false'.
Feb 12 23:21:08.045377 osdx OSDxCLI[781896]: User 'admin' added a new cfg line: 'set system cli configuration logging global info'.
Feb 12 23:21:08.155510 osdx OSDxCLI[781896]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 advisor ADVISOR1'.
Feb 12 23:21:08.254030 osdx OSDxCLI[781896]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 address 10.215.200.50/24'.
Feb 12 23:21:08.402954 osdx OSDxCLI[781896]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 operational 1 command "show version"'.
Feb 12 23:21:08.506516 osdx OSDxCLI[781896]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 operational 2 command "license show"'.
Feb 12 23:21:08.588811 osdx OSDxCLI[781896]: User 'admin' added a new cfg line: 'show working'.
Feb 12 23:21:08.735391 osdx ubnt-cfgd[787700]: inactive
Feb 12 23:21:08.760972 osdx INFO[787708]: FRR daemons did not change
Feb 12 23:21:08.762965 osdx modulelauncher[1440]: + Received data: ['781896', 'osdx.utils.xos', 'set_console_log_level', 'info']
Feb 12 23:21:08.784595 osdx OSDxCLI[781896]: Signal 10 received
Feb 12 23:21:08.872078 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth0
Feb 12 23:21:08.922239 osdx WARNING[787802]: No supported link modes on interface eth0
Feb 12 23:21:08.923840 osdx modulelauncher[787802]: osdx.utils.xos cmd error: /sbin/ethtool -A eth0 autoneg on
Feb 12 23:21:08.923853 osdx modulelauncher[787802]: Command '/sbin/ethtool -A eth0 autoneg on' returned non-zero exit status 76.
Feb 12 23:21:08.925332 osdx modulelauncher[787802]: osdx.utils.xos cmd error: /sbin/ethtool -s eth0 autoneg on advertise Asym_Pause off Pause off --
Feb 12 23:21:08.925355 osdx modulelauncher[787802]: Command '/sbin/ethtool -s eth0 autoneg on advertise Asym_Pause off Pause off --' returned non-zero exit status 75.
Feb 12 23:21:08.940741 osdx cfgd[1631]: [781896]Completed change to active configuration
Feb 12 23:21:08.956217 osdx OSDxCLI[781896]: User 'admin' committed the configuration.
Feb 12 23:21:08.977019 osdx OSDxCLI[781896]: User 'admin' left the configuration menu.
Feb 12 23:21:09.265369 osdx OSDxCLI[781896]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
Feb 12 23:21:09.265960 osdx OSDxCLI[781896]: pam_unix(cli:session): session closed for user admin
Feb 12 23:21:09.266250 osdx OSDxCLI[781896]: User 'admin' entered the configuration menu.
Feb 12 23:21:09.334700 osdx OSDxCLI[781896]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
Feb 12 23:21:09.334955 osdx cfgd[1631]: Execute action [syntax] for node [system advisor ADVISOR1]
Feb 12 23:21:09.335274 osdx OSDxCLI[781896]: pam_unix(cli:session): session closed for user admin
Feb 12 23:21:09.335515 osdx OSDxCLI[781896]: User 'admin' added a new cfg line: 'set system advisor ADVISOR1 test true'.
Feb 12 23:21:09.393054 osdx OSDxCLI[781896]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
Feb 12 23:21:09.398108 osdx OSDxCLI[781896]: pam_unix(cli:session): session closed for user admin
Feb 12 23:21:09.398334 osdx OSDxCLI[781896]: User 'admin' added a new cfg line: 'show changes'.
Feb 12 23:21:09.536629 osdx OSDxCLI[781896]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
Feb 12 23:21:09.544940 osdx ubnt-cfgd[787852]: inactive
Feb 12 23:21:09.556821 osdx cfgd[1631]: [781896]must validation for [system login user admin role] was skipped
Feb 12 23:21:09.556836 osdx cfgd[1631]: Execute action [commit-subtree] for node [system advisor ADVISOR1]
Feb 12 23:21:09.565165 osdx INFO[787860]: FRR daemons did not change
Feb 12 23:21:09.565337 osdx cfgd[1631]: Execute action [end] for node [system advisor ADVISOR1]
Feb 12 23:21:09.571231 osdx cfgd[1631]: [781896]Completed change to active configuration
Feb 12 23:21:09.573204 osdx OSDxCLI[781896]: pam_unix(cli:session): session closed for user admin
Feb 12 23:21:09.573510 osdx OSDxCLI[781896]: User 'admin' committed the configuration.
Feb 12 23:21:09.575108 osdx INFO[787868]: SCRIPT SCRIPT_1 operations:
Feb 12 23:21:09.581153 osdx OSDxCLI[787876]: Tecla::GetLine tcgetattr error
Feb 12 23:21:09.581161 osdx OSDxCLI[787876]: User 'admin' has logged in.
Feb 12 23:21:09.589856 osdx OSDxCLI[787876]: User 'admin' executed a new command: 'show version'.
Feb 12 23:21:09.590785 osdx OSDxCLI[787876]: User 'admin' has logged out.
Feb 12 23:21:09.590792 osdx OSDxCLI[787876]: Tecla::GetLine tcgetattr error
Feb 12 23:21:09.591342 osdx INFO[787868]: Operation 1 'show version
                                          ':

                                            OS vendor:                 Teldat
                                            OS name:                   OSDx
                                            OS version:                v4.2.8.3
                                            OS Linux kernel:           6.1.158
                                            OS built by:               jenkins@diana
                                            OS build date:             Thu Feb 12 15:50:25 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:             6fff9170-6098-5741-8011-75cce55a096a
                                            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 12 Feb 2026 23:21:09 +00:00
                                            Uptime:                    7:03:17
                                            CPU load (1m, 5m, 15m):    0.27 0.18 0.18
                                            CPU usage % (1m):          3.38
                                            Storage usage (kB):        401988/8144384
                                            Memory usage (kB):         472612/1963720
                                            Users logged in:           1
                                            Mode (current/next boot):  user/user

                                            Hostname:                  osdx
Feb 12 23:21:09.597250 osdx OSDxCLI[787882]: Tecla::GetLine tcgetattr error
Feb 12 23:21:09.597257 osdx OSDxCLI[787882]: User 'admin' has logged in.
Feb 12 23:21:09.598471 osdx OSDxCLI[781896]: User 'admin' left the configuration menu.
Feb 12 23:21:09.599748 osdx OSDxCLI[787882]: Tecla::GetLine tcgetattr error
Feb 12 23:21:09.602257 osdx OSDxCLI[787882]: Tecla::GetLine tcgetattr error
Feb 12 23:21:09.602455 osdx OSDxCLI[787882]: User 'admin' executed a new command: 'license show'.
Feb 12 23:21:09.603597 osdx OSDxCLI[787882]: User 'admin' has logged out.
Feb 12 23:21:09.603603 osdx OSDxCLI[787882]: Tecla::GetLine tcgetattr error
Feb 12 23:21:09.604287 osdx INFO[787868]: 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  |
                                          +-----------------+----------+----------+
Feb 12 23:21:09.723331 osdx OSDxCLI[781896]: 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::c423:55ff:fe7f:3110/64  up     up
dum1  fe80::28e4:4ff:fe7a:9041/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.3
# Thu 12 Feb 2026 23:21:22 +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.3
# Thu 12 Feb 2026 23:21:23 +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.3
# Thu 12 Feb 2026 23:21:25 +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]