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 the command show running on DUT0 and check whether the output contains the following tokens:

set system description 'advisor applied'
Show output
# Teldat OSDx VM version v4.2.10.3
# Fri 24 Jul 2026 13:37:49 +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 the command system journal show | cat on DUT0 and check whether the output contains the following tokens:

v4.2.10.3
Show output
Jul 24 13:37:54.299210 osdx systemd-journald[2180]: Runtime Journal (/run/log/journal/3a8dbab828fc40a183893e468c03e10b) is 1.9M, max 13.8M, 11.9M free.
Jul 24 13:37:54.301067 osdx systemd-journald[2180]: Received client request to rotate journal, rotating.
Jul 24 13:37:54.301127 osdx systemd-journald[2180]: Vacuuming done, freed 0B of archived journals from /run/log/journal/3a8dbab828fc40a183893e468c03e10b.
Jul 24 13:37:54.308805 osdx OSDxCLI[833831]: User 'admin' executed a new command: 'system journal clear'.
Jul 24 13:37:54.520605 osdx OSDxCLI[833831]: User 'admin' executed a new command: 'system coredump delete all'.
Jul 24 13:37:54.766968 osdx OSDxCLI[833831]: User 'admin' entered the configuration menu.
Jul 24 13:37:54.842198 osdx OSDxCLI[833831]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 advisor ADVISOR1'.
Jul 24 13:37:54.934538 osdx OSDxCLI[833831]: User 'admin' added a new cfg line: 'set system advisor ADVISOR1 test false'.
Jul 24 13:37:55.001819 osdx OSDxCLI[833831]: User 'admin' added a new cfg line: 'set system cli configuration logging global info'.
Jul 24 13:37:55.105573 osdx OSDxCLI[833831]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 advisor ADVISOR1'.
Jul 24 13:37:55.195248 osdx OSDxCLI[833831]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 address 10.215.200.50/24'.
Jul 24 13:37:55.263894 osdx OSDxCLI[833831]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 operational 1 command "show version"'.
Jul 24 13:37:55.358685 osdx OSDxCLI[833831]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 operational 2 command "license show"'.
Jul 24 13:37:55.434611 osdx OSDxCLI[833831]: User 'admin' added a new cfg line: 'show working'.
Jul 24 13:37:55.568669 osdx ubnt-cfgd[850812]: inactive
Jul 24 13:37:55.608267 osdx INFO[850823]: FRR daemons did not change
Jul 24 13:37:55.610052 osdx modulelauncher[1727]: + Received data: ['833831', 'osdx.utils.xos', 'set_console_log_level', 'info']
Jul 24 13:37:55.630443 osdx OSDxCLI[833831]: Signal 10 received
Jul 24 13:37:55.701065 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth0
Jul 24 13:37:55.755238 osdx WARNING[850919]: No supported link modes on interface eth0
Jul 24 13:37:55.756799 osdx modulelauncher[850919]: osdx.utils.xos cmd error: /sbin/ethtool -A eth0 autoneg on
Jul 24 13:37:55.756818 osdx modulelauncher[850919]: Command '/sbin/ethtool -A eth0 autoneg on' returned non-zero exit status 76.
Jul 24 13:37:55.758134 osdx modulelauncher[850919]: osdx.utils.xos cmd error: /sbin/ethtool -s eth0 autoneg on advertise Asym_Pause off Pause off --
Jul 24 13:37:55.758144 osdx modulelauncher[850919]: Command '/sbin/ethtool -s eth0 autoneg on advertise Asym_Pause off Pause off --' returned non-zero exit status 75.
Jul 24 13:37:55.938250 osdx cfgd[1923]: [833831]Completed change to active configuration
Jul 24 13:37:55.938774 osdx OSDxCLI[833831]: User 'admin' committed the configuration.
Jul 24 13:37:55.966096 osdx OSDxCLI[833831]: User 'admin' left the configuration menu.
Jul 24 13:37:56.147492 osdx OSDxCLI[833831]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
Jul 24 13:37:56.148011 osdx OSDxCLI[833831]: pam_unix(cli:session): session closed for user admin
Jul 24 13:37:56.148290 osdx OSDxCLI[833831]: User 'admin' entered the configuration menu.
Jul 24 13:37:56.212150 osdx OSDxCLI[833831]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
Jul 24 13:37:56.212427 osdx cfgd[1923]: Execute action [syntax] for node [system advisor ADVISOR1]
Jul 24 13:37:56.212797 osdx OSDxCLI[833831]: pam_unix(cli:session): session closed for user admin
Jul 24 13:37:56.213104 osdx OSDxCLI[833831]: User 'admin' added a new cfg line: 'set system advisor ADVISOR1 test true'.
Jul 24 13:37:56.300997 osdx OSDxCLI[833831]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
Jul 24 13:37:56.306413 osdx OSDxCLI[833831]: pam_unix(cli:session): session closed for user admin
Jul 24 13:37:56.306699 osdx OSDxCLI[833831]: User 'admin' added a new cfg line: 'show changes'.
Jul 24 13:37:56.373737 osdx OSDxCLI[833831]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
Jul 24 13:37:56.382710 osdx ubnt-cfgd[850980]: inactive
Jul 24 13:37:56.395652 osdx cfgd[1923]: [833831]must validation for [system login user admin role] was skipped
Jul 24 13:37:56.395671 osdx cfgd[1923]: Execute action [commit-subtree] for node [system advisor ADVISOR1]
Jul 24 13:37:56.405197 osdx INFO[850989]: FRR daemons did not change
Jul 24 13:37:56.405366 osdx cfgd[1923]: Execute action [end] for node [system advisor ADVISOR1]
Jul 24 13:37:56.418605 osdx cfgd[1923]: [833831]Completed change to active configuration
Jul 24 13:37:56.418883 osdx OSDxCLI[833831]: pam_unix(cli:session): session closed for user admin
Jul 24 13:37:56.419185 osdx OSDxCLI[833831]: User 'admin' committed the configuration.
Jul 24 13:37:56.419988 osdx INFO[850996]: SCRIPT SCRIPT_1 operations:
Jul 24 13:37:56.425768 osdx OSDxCLI[851006]: Tecla::GetLine tcgetattr error
Jul 24 13:37:56.425774 osdx OSDxCLI[851006]: User 'admin' has logged in.
Jul 24 13:37:56.435411 osdx OSDxCLI[833831]: User 'admin' left the configuration menu.
Jul 24 13:37:56.437395 osdx OSDxCLI[851006]: User 'admin' executed a new command: 'show version'.
Jul 24 13:37:56.438529 osdx OSDxCLI[851006]: User 'admin' has logged out.
Jul 24 13:37:56.438536 osdx OSDxCLI[851006]: Tecla::GetLine tcgetattr error
Jul 24 13:37:56.439241 osdx INFO[850996]: Operation 1 'show version
':

OS vendor:                 Teldat
OS name:                   OSDx
OS version:                v4.2.10.3
OS Linux kernel:           6.12.90
OS built by:               jenkins@diana
OS build date:             Fri Jul 24 06:09:07 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:             bef0d282-7da1-5506-a2c2-1cb63c9dc346
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:                      Fri 24 Jul 2026 13:37:56 +00:00
Uptime:                    6:38:46
CPU load (1m, 5m, 15m):    0.39 0.23 0.15
CPU usage % (1m):          6.80
Storage usage (kB):        421340/8144384
Memory usage (kB):         472236/1572524
Users logged in:           1
Mode (current/next boot):  user/user

Hostname:                  osdx
Jul 24 13:37:56.444176 osdx OSDxCLI[851014]: Tecla::GetLine tcgetattr error
Jul 24 13:37:56.444182 osdx OSDxCLI[851014]: User 'admin' has logged in.
Jul 24 13:37:56.448404 osdx OSDxCLI[851014]: Tecla::GetLine tcgetattr error
Jul 24 13:37:56.450949 osdx OSDxCLI[851014]: Tecla::GetLine tcgetattr error
Jul 24 13:37:56.451129 osdx OSDxCLI[851014]: User 'admin' executed a new command: 'license show'.
Jul 24 13:37:56.452000 osdx OSDxCLI[851014]: User 'admin' has logged out.
Jul 24 13:37:56.452004 osdx OSDxCLI[851014]: Tecla::GetLine tcgetattr error
Jul 24 13:37:56.452539 osdx INFO[850996]: Operation 2 'license show
':
License: VM_BASE Firewall eth-Rate-Permit-Full

+-----------------+----------+----------+
| License Item    | Status   | Validity |
+-----------------+----------+----------+
| CELL            | Disabled | -        |
| EDGE            | 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  |
+-----------------+----------+----------+
Jul 24 13:37:56.559776 osdx OSDxCLI[833831]: 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 the command system script SCRIPT_1 activate on DUT0.

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

dum0.*\ndum1
Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
dum0  fe80::9c19:f4ff:fed2:6a1f/64  up     up
dum1  fe80::d855:80ff:fe41:ea0b/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 the command show running on DUT0 and check whether the output contains the following tokens:

set system description 'advisor applied'
Show output
# Teldat OSDx VM version v4.2.10.3
# Fri 24 Jul 2026 13:38:12 +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 the command show running on DUT0 and check whether the output contains the following tokens:

set system description 'advisor applied'
Show output
# Teldat OSDx VM version v4.2.10.3
# Fri 24 Jul 2026 13:38:14 +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 the command show running on DUT0 and check whether the output contains the following tokens:

set system description 'advisor applied'
Show output
# Teldat OSDx VM version v4.2.10.3
# Fri 24 Jul 2026 13:38:17 +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 the command set system script SCRIPT_1 configuration 'set potato' on DUT0 and expect the following 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 the command system script SCRIPT_1 activate on DUT0 and expect no output.

Step 5: Run the command system journal show | grep "CLI Error: Invalid token *" on DUT0 and check whether the output contains the following tokens:

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