local args="loglevel=15 nokaslr printk.synchronous=1 console=ttyS0 dm-mod.create=\"${DM_BOOT_PARAM}\" root=${ROOT_DEV} ro init=/bin/init.sh"
if["$CHROME_TEST"=="0"];then
arg_dm="dm-mod.create"
else
arg_dm="dm"
fi
local args="loglevel=15 nokaslr printk.synchronous=1 console=ttyS0 ${arg_dm}=\"${DM_BOOT_PARAM}\" root=${ROOT_DEV} ro init=/bin/init.sh"
mkdir-p logs/${LOG_N}
...
...
@@ -590,6 +597,153 @@ linear_parser_tests()
124
}
linear_parser_tests_chrome()
{
launch_test \
"linear: should fail (test the test)"\
"-hda ${DL1}"\
/dev/dm-0 \
"dm-linear none ro 4,0 0 linear 8:1 0,0 0 linear 8:2 0,0 0 linear 8:3 0,0 0 linear 8:4 0"\
124 \
1
launch_test \
"linear: with minor"\
"-hda ${DL1}"\
/dev/dm-0 \
"dm-linear none rw 4,$DL1_P1_START$DL1_P1_SIZE linear 8:1 0,$DL1_P2_START$DL1_P2_SIZE linear 8:2 0,$DL1_P3_START$DL1_P3_SIZE linear 8:3 0,$DL1_P4_START$DL1_P4_SIZE linear 8:4 0"\
0 \
1
UUID=123123123123
launch_test \
"linear: with uuid (but booting from /dev/dm-0)"\
"-hda ${DL1}"\
"/dev/dm-0"\
"dm-linear ${UUID} rw 4,$DL1_P1_START$DL1_P1_SIZE linear 8:1 0,$DL1_P2_START$DL1_P2_SIZE linear 8:2 0,$DL1_P3_START$DL1_P3_SIZE linear 8:3 0,$DL1_P4_START$DL1_P4_SIZE linear 8:4 0"\
0 \
1
launch_test \
"linear: with device path"\
"-hda ${DL1}"\
/dev/dm-0 \
"dm-linear none rw 4,$DL1_P1_START$DL1_P1_SIZE linear /dev/sda1 0,$DL1_P2_START$DL1_P2_SIZE linear /dev/sda2 0,$DL1_P3_START$DL1_P3_SIZE linear /dev/sda3 0,$DL1_P4_START$DL1_P4_SIZE linear /dev/sda4 0"\
0 \
1
args="2 dm-linear1 none rw 4,$DL1_P1_START$DL1_P1_SIZE linear /dev/sda1 0,$DL1_P2_START$DL1_P2_SIZE linear /dev/sda2 0,$DL1_P3_START$DL1_P3_SIZE linear /dev/sda3 0,$DL1_P4_START$DL1_P4_SIZE linear /dev/sda4 0"
args+=",dm-linear2 none rw 4,$DL2_P1_START$DL2_P1_SIZE linear /dev/sdb1 0,$DL2_P2_START$DL2_P2_SIZE linear /dev/sdb2 0,$DL2_P3_START$DL2_P3_SIZE linear /dev/sdb3 0,$DL2_P4_START$DL2_P4_SIZE linear /dev/sdb4 0"
launch_test \
"linear: multiple disks (boot sda)"\
"-hda ${DL1} -hdb ${DL2} "\
/dev/dm-0 \
"$args"\
0 \
1
args="2 dm-linear1 none rw 4,$DL1_P1_START$DL1_P1_SIZE linear /dev/sda1 0,$DL1_P2_START$DL1_P2_SIZE linear /dev/sda2 0,$DL1_P3_START$DL1_P3_SIZE linear /dev/sda3 0,$DL1_P4_START$DL1_P4_SIZE linear /dev/sda4 0"
args+=",dm-linear2 none rw 4,$DL2_P1_START$DL2_P1_SIZE linear /dev/sdb1 0,$DL2_P2_START$DL2_P2_SIZE linear /dev/sdb2 0,$DL2_P3_START$DL2_P3_SIZE linear /dev/sdb3 0,$DL2_P4_START$DL2_P4_SIZE linear /dev/sdb4 0"
launch_test \
"linear: multiple disks (boot sdb)"\
"-hda ${DL1} -hdb ${DL2} "\
/dev/dm-1 \
"$args"\
0 \
1
args=" dm-linear none rw 4 , $DL1_P1_START$DL1_P1_SIZE linear 8:1 0 , $DL1_P2_START$DL1_P2_SIZE linear 8:2 0 , $DL1_P3_START$DL1_P3_SIZE linear 8:3 0 , $DL1_P4_START$DL1_P4_SIZE linear 8:4 0 "
args+=" , dm-linear2 none ro 4 , $DL2_P1_START$DL2_P1_SIZE linear /dev/sdb1 0,$DL2_P2_START$DL2_P2_SIZE linear /dev/sdb2 0,$DL2_P3_START$DL2_P3_SIZE linear /dev/sdb3 0,$DL2_P4_START$DL2_P4_SIZE linear /dev/sdb4 0 "
launch_test \
"linear: spaces"\
"-hda ${DL1} -hdb ${DL2} "\
/dev/dm-0 \
"$args"\
0 \
1
launch_test \
"linear: name with space"\
"-hda ${DL1}"\
/dev/dm-0 \
"this is a name none rw 4,$DL1_P1_START$DL1_P1_SIZE linear 8:1 0,$DL1_P2_START$DL1_P2_SIZE linear 8:2 0,$DL1_P3_START$DL1_P3_SIZE linear 8:3 0,$DL1_P4_START$DL1_P4_SIZE linear 8:4 0"\
124 \
1
launch_test \
"linear: bad argument: bad name"\
"-hda ${DL1}"\
/dev/dm-0 \
"/dev/asdf none rw 4,$DL1_P1_START$DL1_P1_SIZE linear 8:1 0,$DL1_P2_START$DL1_P2_SIZE linear 8:2 0,$DL1_P3_START$DL1_P3_SIZE linear 8:3 0,$DL1_P4_START$DL1_P4_SIZE linear 8:4 0"\
124 \
1
launch_test \
"linear: bad argument: bad read/write"\
"-hda ${DL1}"\
/dev/dm-0 \
"dm-linear none BAD 4,$DL1_P1_START$DL1_P1_SIZE linear 8:1 0,$DL1_P2_START$DL1_P2_SIZE linear 8:2 0,$DL1_P3_START$DL1_P3_SIZE linear 8:3 0,$DL1_P4_START$DL1_P4_SIZE linear 8:4 0"\
124 \
1
launch_test \
"linear: bad argument: missing field"\
"-hda ${DL1}"\
/dev/dm-0 \
"dm-linear none rw 0"\
124 \
0 \
1
launch_test \
"linear: bad argument: empty targets"\
"-hda ${DL1}"\
/dev/dm-0 \
"dm-linear none rw 0,"\
124 \
0 \
1
launch_test \
"linear: bad argument: empty"\
"-hda ${DL1}"\
/dev/dm-0 \
""\
124 \
0 \
1
launch_test \
"linear: ending with colon (empty device)"\
"-hda ${DL1}"\
/dev/dm-0 \
"dm-linear none rw 4,$DL1_P1_START$DL1_P1_SIZE linear /dev/sda1 0,$DL1_P2_START$DL1_P2_SIZE linear /dev/sda2 0,$DL1_P3_START$DL1_P3_SIZE linear /dev/sda3 0,$DL1_P4_START$DL1_P4_SIZE linear /dev/sda4 0,"\
124 \
0 \
1
name="this is a really loooooooooooong name for a deviceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee - reaaaaaaaaaly loooooooooooooooooooooooooong nnnnnnnnnnnnnnnnnnnname"
name+=" this is a really loooooooooooong name for a deviceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee - reaaaaaaaaaly loooooooooooooooooooooooooong nnnnnnnnnnnnnnnnnnnname"
name+=" this is a really loooooooooooong name for a deviceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee - reaaaaaaaaaly loooooooooooooooooooooooooong nnnnnnnnnnnnnnnnnnnname"
name+=" this is a really loooooooooooong name for a deviceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee - reaaaaaaaaaly loooooooooooooooooooooooooong nnnnnnnnnnnnnnnnnnnname"
name+=" this is a really loooooooooooong name for a deviceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee - reaaaaaaaaaly loooooooooooooooooooooooooong nnnnnnnnnnnnnnnnnnnname"
name+=" this is a really loooooooooooong name for a deviceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee - reaaaaaaaaaly loooooooooooooooooooooooooong nnnnnnnnnnnnnnnnnnnname"
name+=" this is a really loooooooooooong name for a deviceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee - reaaaaaaaaaly loooooooooooooooooooooooooong nnnnnnnnnnnnnnnnnnnname"
name+=" this is a really loooooooooooong name for a deviceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee - reaaaaaaaaaly loooooooooooooooooooooooooong nnnnnnnnnnnnnnnnnnnname"
name+=" this is a really loooooooooooong name for a deviceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee - reaaaaaaaaaly loooooooooooooooooooooooooong nnnnnnnnnnnnnnnnnnnname"
name+=" this is a really loooooooooooong name for a deviceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee - reaaaaaaaaaly loooooooooooooooooooooooooong nnnnnnnnnnnnnnnnnnnname"
name+=" this is a really loooooooooooong name for a deviceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee - reaaaaaaaaaly loooooooooooooooooooooooooong nnnnnnnnnnnnnnnnnnnname"
launch_test \
"linear: bad argument: too long name"\
"-hda ${DL1}"\
/dev/dm-0 \
"$name none rw 4,$DL1_P1_START$DL1_P1_SIZE linear 8:1 0,$DL1_P2_START$DL1_P2_SIZE linear 8:2 0,$DL1_P3_START$DL1_P3_SIZE linear 8:3 0,$DL1_P4_START$DL1_P4_SIZE linear 8:4 0"\
args="dm-linear1,,1,rw,$DL1_P1_START$DL1_P1_SIZE linear /dev/sda1 0,$DL1_P2_START$DL1_P2_SIZE linear /dev/sda2 0,$DL1_P3_START$DL1_P3_SIZE linear /dev/sda3 0,$DL1_P4_START$DL1_P4_SIZE linear /dev/sda4 0"
...
...
@@ -823,6 +1103,65 @@ misc_tests()
"$args"
}
misc_tests_chrome()
{
args="6 dm-linear1 none rw 4,$DL1_P1_START$DL1_P1_SIZE linear /dev/sda1 0,$DL1_P2_START$DL1_P2_SIZE linear /dev/sda2 0,$DL1_P3_START$DL1_P3_SIZE linear /dev/sda3 0,$DL1_P4_START$DL1_P4_SIZE linear /dev/sda4 0"
args+=",dm-linear2 none rw 4,$DL2_P1_START$DL2_P1_SIZE linear /dev/sdb1 0,$DL2_P2_START$DL2_P2_SIZE linear /dev/sdb2 0,$DL2_P3_START$DL2_P3_SIZE linear /dev/sdb3 0,$DL2_P4_START$DL2_P4_SIZE linear /dev/sdb4 0"