Test obtain_device_info for ZyXEL NBG6817 using the dual-flag method. Partition 1 active (dual flag reads "ff" which matches partition 1's param_values). -- File fs/open~_tmp_sysinfo_board_name.txt -- zyxel,nbg6817 -- End -- -- File fs/popen~_lib_functions_sh_find_mtd_part_0_dual_flag_.txt -- /dev/mtdblock12 -- End -- -- File fs/popen~dd_if_dev_mtdblock12_bs_1_count_1_skip_0_2_dev_null_hexdump_-n_1_-e_1_1_02x_.txt -- ff -- End -- -- File fs/popen~_etc_os-release_2_dev_null_echo_OPENWRT_RELEASE_2_dev_null.txt -- OpenWrt 24.10.0 r28427-6df0e3d02a -- End -- -- File fs/open~_proc_version.txt -- Linux version 6.6.63 (builder@buildhost) (arm-openwrt-linux-muslgnueabi-gcc) #0 -- End -- -- File fs/popen~dd_if_dev_mmcblk0p4_bs_1_skip_32_count_64.txt -- Linux version 6.6.63 OpenWrt -- End -- -- File fs/popen~dd_if_dev_mmcblk0p7_bs_1_skip_32_count_64.txt -- Linux-6.6.50 ZyXEL -- End -- -- Testcase -- let ar = require('advanced_reboot'); let api = ar["luci.advanced-reboot"]; let result = api.obtain_device_info.call(); printf("vendor: %s\n", result.device.vendor); printf("model: %s\n", result.device.model); printf("board: %s\n", result.device.board); printf("active: %s\n", result.device.partition_active); printf("partitions: %d\n", length(result.partitions)); let p1 = result.partitions[0]; printf("p1: number=%s label=%s os=%s\n", p1.number, p1.label, p1.os); let p2 = result.partitions[1]; printf("p2: number=%s label=%s os=%s\n", p2.number, p2.label, p2.os); -- End -- -- Expect stdout -- vendor: ZyXEL model: NBG6817 board: zyxel,nbg6817 active: 1 partitions: 2 p1: number=1 label=OpenWrt 24.10.0 r28427-6df0e3d02a os=6.6.63 p2: number=2 label=ZyXEL os=6.6.50 -- End --