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.4 # Thu 19 Feb 2026 13:50:03 +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.4Show output
Feb 19 13:50:09.341830 osdx systemd-journald[678431]: Runtime Journal (/run/log/journal/69bd8e6fd19244c08e519827aa7e309f) is 2.3M, max 17.2M, 14.9M free. Feb 19 13:50:09.345785 osdx systemd-journald[678431]: Received client request to rotate journal, rotating. Feb 19 13:50:09.345869 osdx systemd-journald[678431]: Vacuuming done, freed 0B of archived journals from /run/log/journal/69bd8e6fd19244c08e519827aa7e309f. Feb 19 13:50:09.356744 osdx OSDxCLI[699055]: User 'admin' executed a new command: 'system journal clear'. Feb 19 13:50:09.633673 osdx OSDxCLI[699055]: User 'admin' executed a new command: 'system coredump delete all'. Feb 19 13:50:09.938881 osdx OSDxCLI[699055]: User 'admin' entered the configuration menu. Feb 19 13:50:10.010620 osdx OSDxCLI[699055]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 advisor ADVISOR1'. Feb 19 13:50:10.124490 osdx OSDxCLI[699055]: User 'admin' added a new cfg line: 'set system advisor ADVISOR1 test false'. Feb 19 13:50:10.217850 osdx OSDxCLI[699055]: User 'admin' added a new cfg line: 'set system cli configuration logging global info'. Feb 19 13:50:10.348035 osdx OSDxCLI[699055]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 advisor ADVISOR1'. Feb 19 13:50:10.496374 osdx OSDxCLI[699055]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 address 10.215.200.50/24'. Feb 19 13:50:10.588579 osdx OSDxCLI[699055]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 operational 1 command "show version"'. Feb 19 13:50:10.708501 osdx OSDxCLI[699055]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 operational 2 command "license show"'. Feb 19 13:50:10.791856 osdx OSDxCLI[699055]: User 'admin' added a new cfg line: 'show working'. Feb 19 13:50:10.912138 osdx ubnt-cfgd[758938]: inactive Feb 19 13:50:10.940297 osdx INFO[758946]: FRR daemons did not change Feb 19 13:50:10.942489 osdx modulelauncher[1668]: + Received data: ['699055', 'osdx.utils.xos', 'set_console_log_level', 'info'] Feb 19 13:50:10.962231 osdx OSDxCLI[699055]: Signal 10 received Feb 19 13:50:11.153794 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth0 Feb 19 13:50:11.202857 osdx WARNING[759040]: No supported link modes on interface eth0 Feb 19 13:50:11.204636 osdx modulelauncher[759040]: osdx.utils.xos cmd error: /sbin/ethtool -A eth0 autoneg on Feb 19 13:50:11.204651 osdx modulelauncher[759040]: Command '/sbin/ethtool -A eth0 autoneg on' returned non-zero exit status 76. Feb 19 13:50:11.206109 osdx modulelauncher[759040]: osdx.utils.xos cmd error: /sbin/ethtool -s eth0 autoneg on advertise Asym_Pause off Pause off -- Feb 19 13:50:11.206119 osdx modulelauncher[759040]: Command '/sbin/ethtool -s eth0 autoneg on advertise Asym_Pause off Pause off --' returned non-zero exit status 75. Feb 19 13:50:11.219666 osdx cfgd[1859]: [699055]Completed change to active configuration Feb 19 13:50:11.233479 osdx OSDxCLI[699055]: User 'admin' committed the configuration. Feb 19 13:50:12.698168 osdx OSDxCLI[699055]: User 'admin' left the configuration menu. Feb 19 13:50:13.264138 osdx OSDxCLI[699055]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000) Feb 19 13:50:13.264797 osdx OSDxCLI[699055]: pam_unix(cli:session): session closed for user admin Feb 19 13:50:13.265283 osdx OSDxCLI[699055]: User 'admin' entered the configuration menu. Feb 19 13:50:13.341901 osdx OSDxCLI[699055]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000) Feb 19 13:50:13.342344 osdx cfgd[1859]: Execute action [syntax] for node [system advisor ADVISOR1] Feb 19 13:50:13.342767 osdx OSDxCLI[699055]: pam_unix(cli:session): session closed for user admin Feb 19 13:50:13.343040 osdx OSDxCLI[699055]: User 'admin' added a new cfg line: 'set system advisor ADVISOR1 test true'. Feb 19 13:50:13.488639 osdx OSDxCLI[699055]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000) Feb 19 13:50:13.496976 osdx OSDxCLI[699055]: pam_unix(cli:session): session closed for user admin Feb 19 13:50:13.497318 osdx OSDxCLI[699055]: User 'admin' added a new cfg line: 'show changes'. Feb 19 13:50:13.584125 osdx OSDxCLI[699055]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000) Feb 19 13:50:13.595902 osdx ubnt-cfgd[759090]: inactive Feb 19 13:50:13.614241 osdx cfgd[1859]: [699055]must validation for [system login user admin role] was skipped Feb 19 13:50:13.614258 osdx cfgd[1859]: Execute action [commit-subtree] for node [system advisor ADVISOR1] Feb 19 13:50:13.629212 osdx INFO[759098]: FRR daemons did not change Feb 19 13:50:13.632727 osdx cfgd[1859]: Execute action [end] for node [system advisor ADVISOR1] Feb 19 13:50:13.640865 osdx cfgd[1859]: [699055]Completed change to active configuration Feb 19 13:50:13.643318 osdx OSDxCLI[699055]: pam_unix(cli:session): session closed for user admin Feb 19 13:50:13.643972 osdx OSDxCLI[699055]: User 'admin' committed the configuration. Feb 19 13:50:13.653896 osdx INFO[759111]: SCRIPT SCRIPT_1 operations: Feb 19 13:50:13.661228 osdx OSDxCLI[759115]: Tecla::GetLine tcgetattr error Feb 19 13:50:13.661234 osdx OSDxCLI[759115]: User 'admin' has logged in. Feb 19 13:50:13.675541 osdx OSDxCLI[759115]: User 'admin' executed a new command: 'show version'. Feb 19 13:50:13.677983 osdx OSDxCLI[759115]: User 'admin' has logged out. Feb 19 13:50:13.677994 osdx OSDxCLI[759115]: Tecla::GetLine tcgetattr error Feb 19 13:50:13.679345 osdx INFO[759111]: Operation 1 'show version ': OS vendor: Teldat OS name: OSDx OS version: v4.2.8.4 OS Linux kernel: 6.1.162 OS built by: jenkins@diana OS build date: Thu Feb 19 06:52:11 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: 0e417513-dcc4-5128-8011-f6d120b5b1bd 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 19 Feb 2026 13:50:13 +00:00 Uptime: 6:32:58 CPU load (1m, 5m, 15m): 0.06 0.14 0.14 CPU usage % (1m): 2.67 Storage usage (kB): 401776/8144384 Memory usage (kB): 448352/1963708 Users logged in: 1 Mode (current/next boot): user/user Hostname: osdx Feb 19 13:50:13.692928 osdx OSDxCLI[759121]: Tecla::GetLine tcgetattr error Feb 19 13:50:13.693530 osdx OSDxCLI[759121]: User 'admin' has logged in. Feb 19 13:50:13.699103 osdx OSDxCLI[759121]: Tecla::GetLine tcgetattr error Feb 19 13:50:13.703168 osdx OSDxCLI[759121]: Tecla::GetLine tcgetattr error Feb 19 13:50:13.703501 osdx OSDxCLI[759121]: User 'admin' executed a new command: 'license show'. Feb 19 13:50:13.705274 osdx OSDxCLI[759121]: User 'admin' has logged out. Feb 19 13:50:13.705283 osdx OSDxCLI[759121]: Tecla::GetLine tcgetattr error Feb 19 13:50:13.706252 osdx INFO[759111]: 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 19 13:50:13.720735 osdx OSDxCLI[699055]: User 'admin' left the configuration menu. Feb 19 13:50:13.899940 osdx OSDxCLI[699055]: 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.*\ndum1Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- dum0 fe80::2448:9cff:fe97:fbef/64 up up dum1 fe80::742f:f2ff:fe2e:4978/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.4 # Thu 19 Feb 2026 13:50:33 +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.4 # Thu 19 Feb 2026 13:50:34 +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.4 # Thu 19 Feb 2026 13:50:35 +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]