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.0 # Tue 19 May 2026 16:42:55 +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.0Show output
May 19 16:42:59.000197 osdx systemd-timedated[611010]: Changed local time to Tue 2026-05-19 16:42:59 UTC May 19 16:42:59.001392 osdx OSDxCLI[542452]: User 'admin' executed a new command: 'set date 2026-05-19 16:42:59'. May 19 16:42:59.002687 osdx systemd-journald[505760]: Time jumped backwards, rotating. May 19 16:42:59.278549 osdx systemd-journald[505760]: Runtime Journal (/run/log/journal/d1b141b298644f3ea5560bad25bf4943) is 1.8M, max 13.8M, 11.9M free. May 19 16:42:59.278987 osdx systemd-journald[505760]: Received client request to rotate journal, rotating. May 19 16:42:59.279017 osdx systemd-journald[505760]: Vacuuming done, freed 0B of archived journals from /run/log/journal/d1b141b298644f3ea5560bad25bf4943. May 19 16:42:59.287429 osdx OSDxCLI[542452]: User 'admin' executed a new command: 'system journal clear'. May 19 16:42:59.481175 osdx OSDxCLI[542452]: User 'admin' executed a new command: 'system coredump delete all'. May 19 16:42:59.676915 osdx OSDxCLI[542452]: User 'admin' entered the configuration menu. May 19 16:42:59.730991 osdx OSDxCLI[542452]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 advisor ADVISOR1'. May 19 16:42:59.824190 osdx OSDxCLI[542452]: User 'admin' added a new cfg line: 'set system advisor ADVISOR1 test false'. May 19 16:42:59.876024 osdx OSDxCLI[542452]: User 'admin' added a new cfg line: 'set system cli configuration logging global info'. May 19 16:42:59.970541 osdx OSDxCLI[542452]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 advisor ADVISOR1'. May 19 16:43:00.045955 osdx OSDxCLI[542452]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 address 10.215.200.50/24'. May 19 16:43:00.115691 osdx OSDxCLI[542452]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 operational 1 command "show version"'. May 19 16:43:00.164416 osdx OSDxCLI[542452]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 operational 2 command "license show"'. May 19 16:43:00.270682 osdx OSDxCLI[542452]: User 'admin' added a new cfg line: 'show working'. May 19 16:43:00.324555 osdx ubnt-cfgd[611289]: inactive May 19 16:43:00.345543 osdx INFO[611298]: FRR daemons did not change May 19 16:43:00.347118 osdx modulelauncher[1723]: + Received data: ['542452', 'osdx.utils.xos', 'set_console_log_level', 'info'] May 19 16:43:00.364257 osdx OSDxCLI[542452]: Signal 10 received May 19 16:43:00.422732 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth0 May 19 16:43:00.466909 osdx WARNING[611394]: No supported link modes on interface eth0 May 19 16:43:00.468215 osdx modulelauncher[611394]: osdx.utils.xos cmd error: /sbin/ethtool -A eth0 autoneg on May 19 16:43:00.468227 osdx modulelauncher[611394]: Command '/sbin/ethtool -A eth0 autoneg on' returned non-zero exit status 76. May 19 16:43:00.469327 osdx modulelauncher[611394]: osdx.utils.xos cmd error: /sbin/ethtool -s eth0 autoneg on advertise Asym_Pause off Pause off -- May 19 16:43:00.469334 osdx modulelauncher[611394]: Command '/sbin/ethtool -s eth0 autoneg on advertise Asym_Pause off Pause off --' returned non-zero exit status 75. May 19 16:43:00.654558 osdx cfgd[1918]: [542452]Completed change to active configuration May 19 16:43:00.655179 osdx OSDxCLI[542452]: User 'admin' committed the configuration. May 19 16:43:00.701850 osdx OSDxCLI[542452]: User 'admin' left the configuration menu. May 19 16:43:00.829032 osdx OSDxCLI[542452]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000) May 19 16:43:00.829489 osdx OSDxCLI[542452]: pam_unix(cli:session): session closed for user admin May 19 16:43:00.829719 osdx OSDxCLI[542452]: User 'admin' entered the configuration menu. May 19 16:43:00.882488 osdx OSDxCLI[542452]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000) May 19 16:43:00.882657 osdx cfgd[1918]: Execute action [syntax] for node [system advisor ADVISOR1] May 19 16:43:00.882974 osdx OSDxCLI[542452]: pam_unix(cli:session): session closed for user admin May 19 16:43:00.883169 osdx OSDxCLI[542452]: User 'admin' added a new cfg line: 'set system advisor ADVISOR1 test true'. May 19 16:43:00.974241 osdx OSDxCLI[542452]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000) May 19 16:43:00.979296 osdx OSDxCLI[542452]: pam_unix(cli:session): session closed for user admin May 19 16:43:00.979492 osdx OSDxCLI[542452]: User 'admin' added a new cfg line: 'show changes'. May 19 16:43:01.025201 osdx OSDxCLI[542452]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000) May 19 16:43:01.033058 osdx ubnt-cfgd[611454]: inactive May 19 16:43:01.044950 osdx cfgd[1918]: [542452]must validation for [system login user admin role] was skipped May 19 16:43:01.044963 osdx cfgd[1918]: Execute action [commit-subtree] for node [system advisor ADVISOR1] May 19 16:43:01.053002 osdx INFO[611463]: FRR daemons did not change May 19 16:43:01.053139 osdx cfgd[1918]: Execute action [end] for node [system advisor ADVISOR1] May 19 16:43:01.062855 osdx cfgd[1918]: [542452]Completed change to active configuration May 19 16:43:01.063072 osdx OSDxCLI[542452]: pam_unix(cli:session): session closed for user admin May 19 16:43:01.063399 osdx OSDxCLI[542452]: User 'admin' committed the configuration. May 19 16:43:01.064308 osdx INFO[611470]: SCRIPT SCRIPT_1 operations: May 19 16:43:01.069294 osdx OSDxCLI[611480]: Tecla::GetLine tcgetattr error May 19 16:43:01.069299 osdx OSDxCLI[611480]: User 'admin' has logged in. May 19 16:43:01.077815 osdx OSDxCLI[611480]: User 'admin' executed a new command: 'show version'. May 19 16:43:01.078652 osdx OSDxCLI[611480]: User 'admin' has logged out. May 19 16:43:01.078657 osdx OSDxCLI[611480]: Tecla::GetLine tcgetattr error May 19 16:43:01.079239 osdx INFO[611470]: Operation 1 'show version ': OS vendor: Teldat OS name: OSDx OS version: v4.2.10.0 OS Linux kernel: 6.12.74 OS built by: jenkins@diana OS build date: Tue May 12 07:05:13 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: b23ef8f4-8054-57ac-8b07-23538873b460 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: Tue 19 May 2026 16:43:01 +00:00 Uptime: 4:34:14 CPU load (1m, 5m, 15m): 0.23 0.13 0.13 CPU usage % (1m): 2.67 Storage usage (kB): 420020/8144384 Memory usage (kB): 427788/1572532 Users logged in: 1 Mode (current/next boot): user/user Hostname: osdx May 19 16:43:01.083650 osdx OSDxCLI[611487]: Tecla::GetLine tcgetattr error May 19 16:43:01.083654 osdx OSDxCLI[611487]: User 'admin' has logged in. May 19 16:43:01.086137 osdx OSDxCLI[542452]: User 'admin' left the configuration menu. May 19 16:43:01.086423 osdx OSDxCLI[611487]: Tecla::GetLine tcgetattr error May 19 16:43:01.088331 osdx OSDxCLI[611487]: Tecla::GetLine tcgetattr error May 19 16:43:01.088491 osdx OSDxCLI[611487]: User 'admin' executed a new command: 'license show'. May 19 16:43:01.089292 osdx OSDxCLI[611487]: User 'admin' has logged out. May 19 16:43:01.089297 osdx OSDxCLI[611487]: Tecla::GetLine tcgetattr error May 19 16:43:01.089829 osdx INFO[611470]: 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 | +-----------------+----------+----------+ May 19 16:43:01.214124 osdx OSDxCLI[542452]: 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::38a6:e4ff:feca:c8bd/64 up up dum1 fe80::7009:b3ff:fe7a:7db7/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.0 # Tue 19 May 2026 16:43:13 +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.0 # Tue 19 May 2026 16:43: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.0 # Tue 19 May 2026 16:43:15 +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]