summaryrefslogtreecommitdiffstats
path: root/applications/luci-app-advanced-reboot/tests/02_obtain_device_info/02_zyxel_nbg6817
blob: 475b7f843d58d252fa5fd7433e3c9337d6435d87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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 --