|
| 1 | +#!/bin/sh |
| 2 | + |
| 3 | +. ./d_function_test |
| 4 | + |
| 5 | +RESULT=0 |
| 6 | + |
| 7 | +list_items=' virtio-0987654321 20G 3 unknown(2M),vfat(20M),btrfs(4.3G) virtio-test2 20G 3 unknown(2M),vfat(20M),btrfs(4.3G) virtio-test3 20G 3 unknown(2M),vfat(20M),btrfs(4.3G)' |
| 8 | +####################################### |
| 9 | +asserted_output="$(echo -e '--LIST------ Select A Disk ---------------- |
| 10 | +
|
| 11 | +Select the disk to install the operating system to. |
| 12 | +
|
| 13 | +\033[1mMake sure any important documents and files have been backed up.\033[0m |
| 14 | +
|
| 15 | +Item Disk Size Partitions Filesystems |
| 16 | +0: virtio-0987654321 20G 3 unknown(2M),vfat(20M),btrfs(4.3G) |
| 17 | +1: virtio-test2 20G 3 unknown(2M),vfat(20M),btrfs(4.3G) |
| 18 | +2: virtio-test3 20G 3 unknown(2M),vfat(20M),btrfs(4.3G) |
| 19 | +
|
| 20 | +Please select a item number |
| 21 | +[cenity][][virtio-test3] --list --column=Disk --column=Size --column=Partitions --column=Filesystems --width=1050 --height=340 --title=Select A Disk --text=Select the disk to install the operating system to.\\n\\n<b>Make sure any important documents and files have been backed up.</b>\\n virtio-0987654321 20G 3 unknown(2M),vfat(20M),btrfs(4.3G) virtio-test2 20G 3 unknown(2M),vfat(20M),btrfs(4.3G) virtio-test3 20G 3 unknown(2M),vfat(20M),btrfs(4.3G)')" |
| 22 | +output="$(c_test --list --column=Disk --column=Size --column=Partitions --column=Filesystems --width=1050 --height=340 --title="Select A Disk" --text="Select the disk to install the operating system to.\n\n<b>Make sure any important documents and files have been backed up.</b>\n" ${list_items} <<< "2" 2>&1)" |
| 23 | +compare "$output" "$asserted_output" |
| 24 | + |
| 25 | + |
| 26 | +####################################### |
| 27 | +asserted_output="$(echo -e '--LIST------ Select A Disk ---------------- |
| 28 | +
|
| 29 | +Select the disk to install the operating system to. |
| 30 | +
|
| 31 | +\033[1mMake sure any important documents and files have been backed up.\033[0m |
| 32 | +
|
| 33 | +Item Disk Size Partitions Filesystems |
| 34 | +0: virtio-0987654321 20G 3 unknown(2M),vfat(20M),btrfs(4.3G) |
| 35 | +1: virtio-test2 20G 3 unknown(2M),vfat(20M),btrfs(4.3G) |
| 36 | +2: virtio-test3 20G 3 unknown(2M),vfat(20M),btrfs(4.3G) |
| 37 | +
|
| 38 | +Please select a item number |
| 39 | +[cenity][][virtio-test2] --list --column=Disk --column=Size --column=Partitions --column=Filesystems --width=1050 --height=340 --title=Select A Disk --text=Select the disk to install the operating system to.\\n\\n<b>Make sure any important documents and files have been backed up.</b>\\n virtio-0987654321 20G 3 unknown(2M),vfat(20M),btrfs(4.3G) virtio-test2 20G 3 unknown(2M),vfat(20M),btrfs(4.3G) virtio-test3 20G 3 unknown(2M),vfat(20M),btrfs(4.3G)')" |
| 40 | +output="$(c_test --list --column=Disk --column=Size --column=Partitions --column=Filesystems --width=1050 --height=340 --title="Select A Disk" --text="Select the disk to install the operating system to.\n\n<b>Make sure any important documents and files have been backed up.</b>\n" ${list_items} <<< "1" 2>&1)" |
| 41 | +compare "$output" "$asserted_output" |
| 42 | + |
| 43 | + |
| 44 | +list_items='tik-osimage-Aeon.20240731.raw.xz 1501130408 tik-osimage-Aeon.test2.raw.xz 1501130408 tik-osimage-Aeon.test3.raw.xz 1501130408' |
| 45 | +####################################### |
| 46 | +asserted_output="$(echo -e '--LIST------ Select A Image ---------------- |
| 47 | +
|
| 48 | +Select the operating system image to install. |
| 49 | +
|
| 50 | +Item Image Size |
| 51 | +0: tik-osimage-Aeon.20240731.raw.xz 1501130408 |
| 52 | +1: tik-osimage-Aeon.test2.raw.xz 1501130408 |
| 53 | +2: tik-osimage-Aeon.test3.raw.xz 1501130408 |
| 54 | +
|
| 55 | +Please select a item number |
| 56 | +[cenity][][tik-osimage-Aeon.test2.raw.xz] --list --column=Image --column=Size --title=Select A Image --text=Select the operating system image to install.\\n tik-osimage-Aeon.20240731.raw.xz 1501130408 tik-osimage-Aeon.test2.raw.xz 1501130408 tik-osimage-Aeon.test3.raw.xz 1501130408')" |
| 57 | +output="$(c_test --list --column=Image --column=Size --title="Select A Image" --text="Select the operating system image to install.\n" ${list_items} <<< "1" 2>&1)" |
| 58 | +compare "$output" "$asserted_output" |
| 59 | + |
| 60 | + |
| 61 | +####################################### |
| 62 | +asserted_output="$(echo -e '--LIST------ Select A Image ---------------- |
| 63 | +
|
| 64 | +Select the operating system image to install. |
| 65 | +
|
| 66 | +Item Image Size |
| 67 | +0: tik-osimage-Aeon.20240731.raw.xz 1501130408 |
| 68 | +1: tik-osimage-Aeon.test2.raw.xz 1501130408 |
| 69 | +2: tik-osimage-Aeon.test3.raw.xz 1501130408 |
| 70 | +
|
| 71 | +Please select a item number |
| 72 | +[cenity][][tik-osimage-Aeon.test3.raw.xz] --list --column=Image --column=Size --title=Select A Image --text=Select the operating system image to install.\\n tik-osimage-Aeon.20240731.raw.xz 1501130408 tik-osimage-Aeon.test2.raw.xz 1501130408 tik-osimage-Aeon.test3.raw.xz 1501130408')" |
| 73 | +output="$(c_test --list --column=Image --column=Size --title="Select A Image" --text="Select the operating system image to install.\n" ${list_items} <<< "2" 2>&1)" |
| 74 | +compare "$output" "$asserted_output" |
| 75 | + |
| 76 | +check_result |
0 commit comments