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.1 # Wed 03 Jun 2026 12:14:44 +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.1Show output
Jun 03 12:14:49.339207 osdx systemd-journald[262779]: Runtime Journal (/run/log/journal/140771393e044d28bd27951346e92000) is 1.8M, max 13.8M, 11.9M free. Jun 03 12:14:49.340523 osdx systemd-journald[262779]: Received client request to rotate journal, rotating. Jun 03 12:14:49.340580 osdx systemd-journald[262779]: Vacuuming done, freed 0B of archived journals from /run/log/journal/140771393e044d28bd27951346e92000. Jun 03 12:14:49.350585 osdx OSDxCLI[262613]: User 'admin' executed a new command: 'system journal clear'. Jun 03 12:14:49.601080 osdx OSDxCLI[262613]: User 'admin' executed a new command: 'system coredump delete all'. Jun 03 12:14:49.879664 osdx OSDxCLI[262613]: User 'admin' entered the configuration menu. Jun 03 12:14:49.981392 osdx OSDxCLI[262613]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 advisor ADVISOR1'. Jun 03 12:14:50.108844 osdx OSDxCLI[262613]: User 'admin' added a new cfg line: 'set system advisor ADVISOR1 test false'. Jun 03 12:14:50.172056 osdx OSDxCLI[262613]: User 'admin' added a new cfg line: 'set system cli configuration logging global info'. Jun 03 12:14:50.260932 osdx OSDxCLI[262613]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 advisor ADVISOR1'. Jun 03 12:14:50.344993 osdx OSDxCLI[262613]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 address 10.215.200.50/24'. Jun 03 12:14:50.419153 osdx OSDxCLI[262613]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 operational 1 command "show version"'. Jun 03 12:14:50.528170 osdx OSDxCLI[262613]: User 'admin' added a new cfg line: 'set system script SCRIPT_1 operational 2 command "license show"'. Jun 03 12:14:50.607569 osdx OSDxCLI[262613]: User 'admin' added a new cfg line: 'show working'. Jun 03 12:14:50.701985 osdx ubnt-cfgd[264876]: inactive Jun 03 12:14:50.726563 osdx INFO[264885]: FRR daemons did not change Jun 03 12:14:50.728826 osdx modulelauncher[1704]: + Received data: ['262613', 'osdx.utils.xos', 'set_console_log_level', 'info'] Jun 03 12:14:50.747635 osdx OSDxCLI[262613]: Signal 10 received Jun 03 12:14:50.816536 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth0 Jun 03 12:14:50.867584 osdx WARNING[264981]: No supported link modes on interface eth0 Jun 03 12:14:50.869059 osdx modulelauncher[264981]: osdx.utils.xos cmd error: /sbin/ethtool -A eth0 autoneg on Jun 03 12:14:50.869077 osdx modulelauncher[264981]: Command '/sbin/ethtool -A eth0 autoneg on' returned non-zero exit status 76. Jun 03 12:14:50.870372 osdx modulelauncher[264981]: osdx.utils.xos cmd error: /sbin/ethtool -s eth0 autoneg on advertise Pause off Asym_Pause off -- Jun 03 12:14:50.870382 osdx modulelauncher[264981]: Command '/sbin/ethtool -s eth0 autoneg on advertise Pause off Asym_Pause off --' returned non-zero exit status 75. Jun 03 12:14:51.052065 osdx cfgd[1899]: [262613]Completed change to active configuration Jun 03 12:14:51.052505 osdx OSDxCLI[262613]: User 'admin' committed the configuration. Jun 03 12:14:51.069821 osdx OSDxCLI[262613]: User 'admin' left the configuration menu. Jun 03 12:14:51.224444 osdx OSDxCLI[262613]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000) Jun 03 12:14:51.225053 osdx OSDxCLI[262613]: pam_unix(cli:session): session closed for user admin Jun 03 12:14:51.225337 osdx OSDxCLI[262613]: User 'admin' entered the configuration menu. Jun 03 12:14:51.291292 osdx OSDxCLI[262613]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000) Jun 03 12:14:51.291538 osdx cfgd[1899]: Execute action [syntax] for node [system advisor ADVISOR1] Jun 03 12:14:51.291897 osdx OSDxCLI[262613]: pam_unix(cli:session): session closed for user admin Jun 03 12:14:51.292170 osdx OSDxCLI[262613]: User 'admin' added a new cfg line: 'set system advisor ADVISOR1 test true'. Jun 03 12:14:51.391681 osdx OSDxCLI[262613]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000) Jun 03 12:14:51.399596 osdx OSDxCLI[262613]: pam_unix(cli:session): session closed for user admin Jun 03 12:14:51.399849 osdx OSDxCLI[262613]: User 'admin' added a new cfg line: 'show changes'. Jun 03 12:14:51.480033 osdx OSDxCLI[262613]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000) Jun 03 12:14:51.488874 osdx ubnt-cfgd[265041]: inactive Jun 03 12:14:51.551131 osdx cfgd[1899]: [262613]must validation for [system login user admin role] was skipped Jun 03 12:14:51.551150 osdx cfgd[1899]: Execute action [commit-subtree] for node [system advisor ADVISOR1] Jun 03 12:14:51.561100 osdx INFO[265050]: FRR daemons did not change Jun 03 12:14:51.561304 osdx cfgd[1899]: Execute action [end] for node [system advisor ADVISOR1] Jun 03 12:14:51.575862 osdx cfgd[1899]: [262613]Completed change to active configuration Jun 03 12:14:51.576077 osdx OSDxCLI[262613]: pam_unix(cli:session): session closed for user admin Jun 03 12:14:51.576407 osdx OSDxCLI[262613]: User 'admin' committed the configuration. Jun 03 12:14:51.577869 osdx INFO[265057]: SCRIPT SCRIPT_1 operations: Jun 03 12:14:51.583510 osdx OSDxCLI[265067]: Tecla::GetLine tcgetattr error Jun 03 12:14:51.583517 osdx OSDxCLI[265067]: User 'admin' has logged in. Jun 03 12:14:51.594041 osdx OSDxCLI[265067]: User 'admin' executed a new command: 'show version'. Jun 03 12:14:51.595139 osdx OSDxCLI[265067]: User 'admin' has logged out. Jun 03 12:14:51.595146 osdx OSDxCLI[265067]: Tecla::GetLine tcgetattr error Jun 03 12:14:51.595664 osdx OSDxCLI[262613]: User 'admin' left the configuration menu. Jun 03 12:14:51.595863 osdx INFO[265057]: Operation 1 'show version ': OS vendor: Teldat OS name: OSDx OS version: v4.2.10.1 OS Linux kernel: 6.12.90 OS built by: jenkins@diana OS build date: Wed Jun 3 07:58:33 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: f5af3efe-083f-55bb-b51c-8f037a33d582 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 03 Jun 2026 12:14:51 +00:00 Uptime: 2:19:51 CPU load (1m, 5m, 15m): 0.46 0.27 0.16 CPU usage % (1m): 8.70 Storage usage (kB): 419844/8144384 Memory usage (kB): 434052/1572528 Users logged in: 1 Mode (current/next boot): user/user Hostname: osdx Jun 03 12:14:51.600685 osdx OSDxCLI[265074]: Tecla::GetLine tcgetattr error Jun 03 12:14:51.600691 osdx OSDxCLI[265074]: User 'admin' has logged in. Jun 03 12:14:51.602752 osdx OSDxCLI[265074]: Tecla::GetLine tcgetattr error Jun 03 12:14:51.604876 osdx OSDxCLI[265074]: Tecla::GetLine tcgetattr error Jun 03 12:14:51.605046 osdx OSDxCLI[265074]: User 'admin' executed a new command: 'license show'. Jun 03 12:14:51.605938 osdx OSDxCLI[265074]: User 'admin' has logged out. Jun 03 12:14:51.605944 osdx OSDxCLI[265074]: Tecla::GetLine tcgetattr error Jun 03 12:14:51.606553 osdx INFO[265057]: 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 | +-----------------+----------+----------+ Jun 03 12:14:51.741564 osdx OSDxCLI[262613]: 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::e82e:4aff:fe70:3814/64 up up dum1 fe80::185b:7ff:fe25:9934/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.1 # Wed 03 Jun 2026 12:15:05 +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.1 # Wed 03 Jun 2026 12:15:07 +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.1 # Wed 03 Jun 2026 12:15:08 +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]