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.9.0 # Thu 05 Mar 2026 17:43:36 +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.9.0Show output
Mar 05 17:43:40.290828 osdx systemd-journald[466780]: Runtime Journal (/run/log/journal/78445f9299f9414990e66dc8aa510838) is 1.8M, max 13.8M, 11.9M free. Mar 05 17:43:40.293915 osdx systemd-journald[466780]: Received client request to rotate journal, rotating. Mar 05 17:43:40.293976 osdx systemd-journald[466780]: Vacuuming done, freed 0B of archived journals from /run/log/journal/78445f9299f9414990e66dc8aa510838. Mar 05 17:43:40.300986 osdx OSDxCLI[520305]: User 'admin' executed a new command: 'system journal clear'. Mar 05 17:43:40.523485 osdx OSDxCLI[520305]: User 'admin' executed a new command: 'system coredump delete all'. Mar 05 17:43:40.736059 osdx OSDxCLI[520305]: User 'admin' entered the configuration menu. Mar 05 17:43:40.792762 osdx OSDxCLI[520305]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 advisor ADVISOR1'. Mar 05 17:43:40.881969 osdx OSDxCLI[520305]: User 'admin' added a new cfg line: 'set system advisor ADVISOR1 test false'. Mar 05 17:43:40.937734 osdx OSDxCLI[520305]: User 'admin' added a new cfg line: 'set system cli configuration logging global info'. Mar 05 17:43:41.030415 osdx OSDxCLI[520305]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 advisor ADVISOR1'. Mar 05 17:43:41.112885 osdx OSDxCLI[520305]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 address 10.215.200.50/24'. Mar 05 17:43:41.188070 osdx OSDxCLI[520305]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 operational 1 command "show version"'. Mar 05 17:43:41.242444 osdx OSDxCLI[520305]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 operational 2 command "license show"'. Mar 05 17:43:41.351124 osdx OSDxCLI[520305]: User 'admin' added a new cfg line: 'show working'. Mar 05 17:43:41.414022 osdx ubnt-cfgd[523261]: inactive Mar 05 17:43:41.434509 osdx INFO[523269]: FRR daemons did not change Mar 05 17:43:41.436024 osdx modulelauncher[1672]: + Received data: ['520305', 'osdx.utils.xos', 'set_console_log_level', 'info'] Mar 05 17:43:41.455248 osdx OSDxCLI[520305]: Signal 10 received Mar 05 17:43:41.513954 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth0 Mar 05 17:43:41.570070 osdx WARNING[523363]: No supported link modes on interface eth0 Mar 05 17:43:41.571457 osdx modulelauncher[523363]: osdx.utils.xos cmd error: /sbin/ethtool -A eth0 autoneg on Mar 05 17:43:41.571469 osdx modulelauncher[523363]: Command '/sbin/ethtool -A eth0 autoneg on' returned non-zero exit status 76. Mar 05 17:43:41.572635 osdx modulelauncher[523363]: osdx.utils.xos cmd error: /sbin/ethtool -s eth0 autoneg on advertise Pause off Asym_Pause off -- Mar 05 17:43:41.572646 osdx modulelauncher[523363]: Command '/sbin/ethtool -s eth0 autoneg on advertise Pause off Asym_Pause off --' returned non-zero exit status 75. Mar 05 17:43:41.583319 osdx cfgd[1863]: [520305]Completed change to active configuration Mar 05 17:43:41.597702 osdx OSDxCLI[520305]: User 'admin' committed the configuration. Mar 05 17:43:41.615790 osdx OSDxCLI[520305]: User 'admin' left the configuration menu. Mar 05 17:43:41.814373 osdx OSDxCLI[520305]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000) Mar 05 17:43:41.814876 osdx OSDxCLI[520305]: pam_unix(cli:session): session closed for user admin Mar 05 17:43:41.815091 osdx OSDxCLI[520305]: User 'admin' entered the configuration menu. Mar 05 17:43:41.872008 osdx OSDxCLI[520305]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000) Mar 05 17:43:41.872248 osdx cfgd[1863]: Execute action [syntax] for node [system advisor ADVISOR1] Mar 05 17:43:41.872567 osdx OSDxCLI[520305]: pam_unix(cli:session): session closed for user admin Mar 05 17:43:41.872780 osdx OSDxCLI[520305]: User 'admin' added a new cfg line: 'set system advisor ADVISOR1 test true'. Mar 05 17:43:41.961279 osdx OSDxCLI[520305]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000) Mar 05 17:43:41.966661 osdx OSDxCLI[520305]: pam_unix(cli:session): session closed for user admin Mar 05 17:43:41.966940 osdx OSDxCLI[520305]: User 'admin' added a new cfg line: 'show changes'. Mar 05 17:43:42.014979 osdx OSDxCLI[520305]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000) Mar 05 17:43:42.023718 osdx ubnt-cfgd[523413]: inactive Mar 05 17:43:42.035786 osdx cfgd[1863]: [520305]must validation for [system login user admin role] was skipped Mar 05 17:43:42.035798 osdx cfgd[1863]: Execute action [commit-subtree] for node [system advisor ADVISOR1] Mar 05 17:43:42.042322 osdx INFO[523421]: FRR daemons did not change Mar 05 17:43:42.043028 osdx cfgd[1863]: Execute action [end] for node [system advisor ADVISOR1] Mar 05 17:43:42.047882 osdx cfgd[1863]: [520305]Completed change to active configuration Mar 05 17:43:42.050360 osdx OSDxCLI[520305]: pam_unix(cli:session): session closed for user admin Mar 05 17:43:42.050793 osdx OSDxCLI[520305]: User 'admin' committed the configuration. Mar 05 17:43:42.052587 osdx INFO[523429]: SCRIPT SCRIPT_1 operations: Mar 05 17:43:42.057866 osdx OSDxCLI[523437]: Tecla::GetLine tcgetattr error Mar 05 17:43:42.057871 osdx OSDxCLI[523437]: User 'admin' has logged in. Mar 05 17:43:42.067016 osdx OSDxCLI[523437]: User 'admin' executed a new command: 'show version'. Mar 05 17:43:42.067913 osdx OSDxCLI[523437]: User 'admin' has logged out. Mar 05 17:43:42.067919 osdx OSDxCLI[523437]: Tecla::GetLine tcgetattr error Mar 05 17:43:42.068461 osdx INFO[523429]: Operation 1 'show version ': OS vendor: Teldat OS name: OSDx OS version: v4.2.9.0 OS Linux kernel: 6.12.73 OS built by: jenkins@diana OS build date: Mon Mar 2 07:38:32 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: 4a55925e-1900-562d-80f6-232a38be0f01 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: Thu 05 Mar 2026 17:43:42 +00:00 Uptime: 3:53:28 CPU load (1m, 5m, 15m): 0.07 0.12 0.16 CPU usage % (1m): 2.42 Storage usage (kB): 419356/8144384 Memory usage (kB): 443240/1572708 Users logged in: 1 Mode (current/next boot): user/user Hostname: osdx Mar 05 17:43:42.072839 osdx OSDxCLI[523443]: Tecla::GetLine tcgetattr error Mar 05 17:43:42.072844 osdx OSDxCLI[523443]: User 'admin' has logged in. Mar 05 17:43:42.076323 osdx OSDxCLI[523443]: Tecla::GetLine tcgetattr error Mar 05 17:43:42.078732 osdx OSDxCLI[520305]: User 'admin' left the configuration menu. Mar 05 17:43:42.079150 osdx OSDxCLI[523443]: Tecla::GetLine tcgetattr error Mar 05 17:43:42.079309 osdx OSDxCLI[523443]: User 'admin' executed a new command: 'license show'. Mar 05 17:43:42.080134 osdx OSDxCLI[523443]: User 'admin' has logged out. Mar 05 17:43:42.080139 osdx OSDxCLI[523443]: Tecla::GetLine tcgetattr error Mar 05 17:43:42.080650 osdx INFO[523429]: 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 | +-----------------+----------+----------+ Mar 05 17:43:42.199724 osdx OSDxCLI[520305]: 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::38a2:80ff:fe8e:e4a/64 up up dum1 fe80::54aa:8dff:fec9:29fb/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.9.0 # Thu 05 Mar 2026 17:43:55 +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.9.0 # Thu 05 Mar 2026 17:43:56 +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.9.0 # Thu 05 Mar 2026 17:43:57 +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]