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.4 # Wed 16 Sep 2026 20:19: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 the command system journal show | cat on DUT0 and check whether the output contains the following tokens:
v4.2.10.4Show output
Sep 16 20:19:46.323946 osdx systemd-journald[2158]: Runtime Journal (/run/log/journal/7ab9d0c6c88d486ab30f6cca192546c5) is 1.8M, max 13.8M, 11.9M free. Sep 16 20:19:46.324728 osdx systemd-journald[2158]: Received client request to rotate journal, rotating. Sep 16 20:19:46.324769 osdx systemd-journald[2158]: Vacuuming done, freed 0B of archived journals from /run/log/journal/7ab9d0c6c88d486ab30f6cca192546c5. Sep 16 20:19:46.335888 osdx OSDxCLI[157302]: User 'admin' executed a new command: 'system journal clear'. Sep 16 20:19:46.574423 osdx OSDxCLI[157302]: User 'admin' executed a new command: 'system coredump delete all'. Sep 16 20:19:46.810563 osdx OSDxCLI[157302]: User 'admin' entered the configuration menu. Sep 16 20:19:46.870463 osdx OSDxCLI[157302]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 advisor ADVISOR1'. Sep 16 20:19:46.963737 osdx OSDxCLI[157302]: User 'admin' added a new cfg line: 'set system advisor ADVISOR1 test false'. Sep 16 20:19:47.064572 osdx OSDxCLI[157302]: User 'admin' added a new cfg line: 'set system cli configuration logging global info'. Sep 16 20:19:47.120115 osdx OSDxCLI[157302]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 advisor ADVISOR1'. Sep 16 20:19:47.244370 osdx OSDxCLI[157302]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 address 10.215.200.50/24'. Sep 16 20:19:47.295221 osdx OSDxCLI[157302]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 operational 1 command "show version"'. Sep 16 20:19:47.397755 osdx OSDxCLI[157302]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 operational 2 command "license show"'. Sep 16 20:19:47.462834 osdx OSDxCLI[157302]: User 'admin' added a new cfg line: 'show working'. Sep 16 20:19:47.555272 osdx ubnt-cfgd[180324]: inactive Sep 16 20:19:47.581269 osdx INFO[180335]: FRR daemons did not change Sep 16 20:19:47.583337 osdx modulelauncher[1704]: + Received data: ['157302', 'osdx.utils.xos', 'set_console_log_level', 'info'] Sep 16 20:19:47.605187 osdx OSDxCLI[157302]: Signal 10 received Sep 16 20:19:47.680742 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth0 Sep 16 20:19:47.730566 osdx WARNING[180431]: No supported link modes on interface eth0 Sep 16 20:19:47.732046 osdx modulelauncher[180431]: osdx.utils.xos cmd error: /sbin/ethtool -A eth0 autoneg on Sep 16 20:19:47.732059 osdx modulelauncher[180431]: Command '/sbin/ethtool -A eth0 autoneg on' returned non-zero exit status 76. Sep 16 20:19:47.733344 osdx modulelauncher[180431]: osdx.utils.xos cmd error: /sbin/ethtool -s eth0 autoneg on advertise Pause off Asym_Pause off -- Sep 16 20:19:47.733354 osdx modulelauncher[180431]: Command '/sbin/ethtool -s eth0 autoneg on advertise Pause off Asym_Pause off --' returned non-zero exit status 75. Sep 16 20:19:47.923070 osdx cfgd[1899]: [157302]Completed change to active configuration Sep 16 20:19:47.924736 osdx OSDxCLI[157302]: User 'admin' committed the configuration. Sep 16 20:19:47.951270 osdx OSDxCLI[157302]: User 'admin' left the configuration menu. Sep 16 20:19:48.145492 osdx OSDxCLI[157302]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000) Sep 16 20:19:48.146031 osdx OSDxCLI[157302]: pam_unix(cli:session): session closed for user admin Sep 16 20:19:48.146287 osdx OSDxCLI[157302]: User 'admin' entered the configuration menu. Sep 16 20:19:48.201096 osdx OSDxCLI[157302]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000) Sep 16 20:19:48.201307 osdx cfgd[1899]: Execute action [syntax] for node [system advisor ADVISOR1] Sep 16 20:19:48.201657 osdx OSDxCLI[157302]: pam_unix(cli:session): session closed for user admin Sep 16 20:19:48.201906 osdx OSDxCLI[157302]: User 'admin' added a new cfg line: 'set system advisor ADVISOR1 test true'. Sep 16 20:19:48.296610 osdx OSDxCLI[157302]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000) Sep 16 20:19:48.301896 osdx OSDxCLI[157302]: pam_unix(cli:session): session closed for user admin Sep 16 20:19:48.302142 osdx OSDxCLI[157302]: User 'admin' added a new cfg line: 'show changes'. Sep 16 20:19:48.390641 osdx OSDxCLI[157302]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000) Sep 16 20:19:48.399631 osdx ubnt-cfgd[180492]: inactive Sep 16 20:19:48.413385 osdx cfgd[1899]: [157302]must validation for [system login user admin role] was skipped Sep 16 20:19:48.413412 osdx cfgd[1899]: Execute action [commit-subtree] for node [system advisor ADVISOR1] Sep 16 20:19:48.424085 osdx INFO[180501]: FRR daemons did not change Sep 16 20:19:48.424782 osdx cfgd[1899]: Execute action [end] for node [system advisor ADVISOR1] Sep 16 20:19:48.439036 osdx cfgd[1899]: [157302]Completed change to active configuration Sep 16 20:19:48.439291 osdx OSDxCLI[157302]: pam_unix(cli:session): session closed for user admin Sep 16 20:19:48.439541 osdx OSDxCLI[157302]: User 'admin' committed the configuration. Sep 16 20:19:48.441606 osdx INFO[180508]: SCRIPT SCRIPT_1 operations: Sep 16 20:19:48.446780 osdx OSDxCLI[180519]: Tecla::GetLine tcgetattr error Sep 16 20:19:48.446785 osdx OSDxCLI[180519]: User 'admin' has logged in. Sep 16 20:19:48.456109 osdx OSDxCLI[157302]: User 'admin' left the configuration menu. Sep 16 20:19:48.458206 osdx OSDxCLI[180519]: User 'admin' executed a new command: 'show version'. Sep 16 20:19:48.459373 osdx OSDxCLI[180519]: User 'admin' has logged out. Sep 16 20:19:48.459379 osdx OSDxCLI[180519]: Tecla::GetLine tcgetattr error Sep 16 20:19:48.460147 osdx INFO[180508]: Operation 1 'show version ': OS vendor: Teldat OS name: OSDx OS version: v4.2.10.4 OS Linux kernel: 6.12.95 OS built by: jenkins@diana OS build date: Wed Sep 16 13:15: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: 61dc8fe7-c044-5eaf-ab68-73890bf22d2d 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: Wed 16 Sep 2026 20:19:48 +00:00 Uptime: 1:39:21 CPU load (1m, 5m, 15m): 0.31 0.26 0.20 CPU usage % (1m): 5.70 Storage usage (kB): 420368/8144384 Memory usage (kB): 415708/1572520 Users logged in: 1 Mode (current/next boot): user/user Hostname: osdx Sep 16 20:19:48.465947 osdx OSDxCLI[180526]: Tecla::GetLine tcgetattr error Sep 16 20:19:48.465953 osdx OSDxCLI[180526]: User 'admin' has logged in. Sep 16 20:19:48.469770 osdx OSDxCLI[180526]: Tecla::GetLine tcgetattr error Sep 16 20:19:48.471749 osdx OSDxCLI[180526]: Tecla::GetLine tcgetattr error Sep 16 20:19:48.471917 osdx OSDxCLI[180526]: User 'admin' executed a new command: 'license show'. Sep 16 20:19:48.472794 osdx OSDxCLI[180526]: User 'admin' has logged out. Sep 16 20:19:48.472799 osdx OSDxCLI[180526]: Tecla::GetLine tcgetattr error Sep 16 20:19:48.473383 osdx INFO[180508]: 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 | +-----------------+----------+----------+ Sep 16 20:19:48.603653 osdx OSDxCLI[157302]: 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.*\ndum1Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- dum0 fe80::ec5c:36ff:fed4:2001/64 up up dum1 fe80::5471:a0ff:feab:cfe8/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.4 # Wed 16 Sep 2026 20:20:02 +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.4 # Wed 16 Sep 2026 20:20:04 +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.4 # Wed 16 Sep 2026 20:20:05 +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]