diff options
author | Sami Kerola | 2014-02-16 16:22:56 +0100 |
---|---|---|
committer | Karel Zak | 2014-03-07 11:52:57 +0100 |
commit | 2f791546395cb43f3f93de6c095c812c7cd5237f (patch) | |
tree | 0fe025270e9c5acbb15ef7d433c553a72fdfdf1e /tests/ts/fdisk | |
parent | tools: make config-gen to require build target argument (diff) | |
download | kernel-qcow2-util-linux-2f791546395cb43f3f93de6c095c812c7cd5237f.tar.gz kernel-qcow2-util-linux-2f791546395cb43f3f93de6c095c812c7cd5237f.tar.xz kernel-qcow2-util-linux-2f791546395cb43f3f93de6c095c812c7cd5237f.zip |
tests: check commands needed for running a test exist
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tests/ts/fdisk')
-rwxr-xr-x | tests/ts/fdisk/align-512-4K | 3 | ||||
-rwxr-xr-x | tests/ts/fdisk/align-512-4K-63 | 3 | ||||
-rwxr-xr-x | tests/ts/fdisk/align-512-4K-md | 3 | ||||
-rwxr-xr-x | tests/ts/fdisk/align-512-512 | 3 | ||||
-rwxr-xr-x | tests/ts/fdisk/align-512-512-topology | 3 | ||||
-rwxr-xr-x | tests/ts/fdisk/bsd | 4 | ||||
-rwxr-xr-x | tests/ts/fdisk/gpt | 4 | ||||
-rwxr-xr-x | tests/ts/fdisk/id | 2 | ||||
-rwxr-xr-x | tests/ts/fdisk/mbr-dos-mode | 2 | ||||
-rwxr-xr-x | tests/ts/fdisk/mbr-nondos-mode | 6 | ||||
-rwxr-xr-x | tests/ts/fdisk/oddinput | 2 | ||||
-rwxr-xr-x | tests/ts/fdisk/sunlabel | 2 |
12 files changed, 33 insertions, 4 deletions
diff --git a/tests/ts/fdisk/align-512-4K b/tests/ts/fdisk/align-512-4K index 2b247f802..5d70fe1fa 100755 --- a/tests/ts/fdisk/align-512-4K +++ b/tests/ts/fdisk/align-512-4K @@ -25,6 +25,9 @@ TS_DESC="align 512/4K" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_FDISK" + ts_skip_nonroot DEVICE=$(ts_scsi_debug_init dev_size_mb=50 sector_size=512 physblk_exp=3) diff --git a/tests/ts/fdisk/align-512-4K-63 b/tests/ts/fdisk/align-512-4K-63 index 6190ae152..65f2a7556 100755 --- a/tests/ts/fdisk/align-512-4K-63 +++ b/tests/ts/fdisk/align-512-4K-63 @@ -25,6 +25,9 @@ TS_DESC="align 512/4K +alignment_offset" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_FDISK" + ts_skip_nonroot DEVICE=$(ts_scsi_debug_init dev_size_mb=50 sector_size=512 physblk_exp=3 lowest_aligned=7) diff --git a/tests/ts/fdisk/align-512-4K-md b/tests/ts/fdisk/align-512-4K-md index be078357f..9a2cb88f7 100755 --- a/tests/ts/fdisk/align-512-4K-md +++ b/tests/ts/fdisk/align-512-4K-md @@ -25,6 +25,9 @@ TS_DESC="align 512/4K +MD" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_FDISK" + ts_skip_nonroot DEVICE=$(ts_scsi_debug_init dev_size_mb=50 sector_size=512 physblk_exp=3) diff --git a/tests/ts/fdisk/align-512-512 b/tests/ts/fdisk/align-512-512 index afcb612ef..8057f9339 100755 --- a/tests/ts/fdisk/align-512-512 +++ b/tests/ts/fdisk/align-512-512 @@ -24,6 +24,9 @@ TS_DESC="align 512/512" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_FDISK" + ts_skip_nonroot DEVICE=$(ts_device_init 50) diff --git a/tests/ts/fdisk/align-512-512-topology b/tests/ts/fdisk/align-512-512-topology index 8cc300929..f988b4e42 100755 --- a/tests/ts/fdisk/align-512-512-topology +++ b/tests/ts/fdisk/align-512-512-topology @@ -25,6 +25,9 @@ TS_DESC="align 512/512 +topology" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_FDISK" + ts_skip_nonroot diff --git a/tests/ts/fdisk/bsd b/tests/ts/fdisk/bsd index 23ac0537e..7e3c78726 100755 --- a/tests/ts/fdisk/bsd +++ b/tests/ts/fdisk/bsd @@ -22,6 +22,8 @@ TS_DESC="nested BSD" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_FDISK" + FDISK_CMD_CREATE_DOSLABEL="o\n" # create dos label FDISK_CMD_SETID="x\ni\n0x1\nr\n" # set non-random ID FDISK_CMD_WRITE_CLOSE="w\nq\n" # write to image @@ -35,7 +37,7 @@ FDISK_CMD_BSD_CREATE_PART="b\nn\na\n\n+1M\n" # add BSD partition 'a', size 1MiB FDISK_CMD_BSD_PARTTYPE="b\nt\na\n7\n" # set partition 'a' to type 4.2BSD FDISK_CMD_BSD_LIST_TYPES="b\nl\nq\n" # list supported PT types and quit -#set -x +#set -x function print_layout { echo -ne "\n---layout----------" >> $TS_OUTPUT diff --git a/tests/ts/fdisk/gpt b/tests/ts/fdisk/gpt index 75bd006e7..3c174e968 100755 --- a/tests/ts/fdisk/gpt +++ b/tests/ts/fdisk/gpt @@ -22,6 +22,8 @@ TS_DESC="GPT" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_FDISK" + FDISK_CMD_CREATE_GPTLABEL="g\n" # create GPT label FDISK_CMD_WRITE_CLOSE="w\nq\n" # write to image @@ -29,7 +31,7 @@ FDISK_CMD_CHANGE_TYPE_BY_NUM="t\n1\n1\n" # set 1st partition to EFI System # set 5th partition to Linux swap FDISK_CMD_CHANGE_TYPE_BY_UUID="t\n5\n0657FD6D-A4AB-43C4-84E5-0933C84B4F4F\n" -FDISK_CMD_DELETE_PART="d\n2\n" # delete 2nd partition +FDISK_CMD_DELETE_PART="d\n2\n" # delete 2nd partition FDISK_CMD_CREATE_PART="n\n2\n\n\n" # create 2nd partition function print_layout { diff --git a/tests/ts/fdisk/id b/tests/ts/fdisk/id index 866cf6ecf..a24d793e8 100755 --- a/tests/ts/fdisk/id +++ b/tests/ts/fdisk/id @@ -20,6 +20,8 @@ TS_DESC="MBR - id" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_FDISK" + FDISK_CMD_ID1="x\ni\n0x1\nr\nw\n" FDISK_CMD_ID2="x\ni\n0x2\nr\nw\n" diff --git a/tests/ts/fdisk/mbr-dos-mode b/tests/ts/fdisk/mbr-dos-mode index 45b315b64..6d517ea3e 100755 --- a/tests/ts/fdisk/mbr-dos-mode +++ b/tests/ts/fdisk/mbr-dos-mode @@ -22,6 +22,8 @@ TS_DESC="MBR - dos mode" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_FDISK" + FDISK_CMD_INIT="x\ni\n0x1\nr\n" FDISK_CMD_WRITE_CLOSE="w\nq\n" FDISK_CMD_CREATE_DOSLABEL="o\n" #create dos label diff --git a/tests/ts/fdisk/mbr-nondos-mode b/tests/ts/fdisk/mbr-nondos-mode index 878c1190b..9c38f3aff 100755 --- a/tests/ts/fdisk/mbr-nondos-mode +++ b/tests/ts/fdisk/mbr-nondos-mode @@ -20,6 +20,8 @@ TS_DESC="MBR - non-dos mode" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_FDISK" + # cmd to changes system id to 0x1 FDISK_CMD_INIT="x\ni\n0x1\nr\n" FDISK_CMD_WRITE_CLOSE="w\nq\n" @@ -27,7 +29,7 @@ FDISK_CMD_CREATE_DOSLABEL="o\n" #create dos label FDISK_CMD_CREATE_1PRIMARY="n\np\n\n\n+3M\n" # create primary partition of size 3MiB FDISK_CMD_CREATE_2PRIMARY="n\np\n\n\n+2M\n" # create primary partition of size 2MiB FDISK_CMD_SET_ACTIVE="a\n1\n" # set first partition active -FDISK_CMD_CREATE_EXTENDED="n\ne\n\n\n\n" # create extended partition +FDISK_CMD_CREATE_EXTENDED="n\ne\n\n\n\n" # create extended partition FDISK_CMD_CREATE_LOGICAL="n\nl\n\n+2M\n" # create next logical partition of size 10 sectors FDISK_CMD_DELETE_LOGICALS="d\n6\nd\n5\nd\n6\n" # delete middle, head, tail, last partitions FDISK_CMD_DELETE_1PRIMARY="d\n1\n" # delete first primary @@ -40,7 +42,7 @@ function print_layout { echo -ne "-------------------\n\n" >> $TS_OUTPUT } -#set -x +#set -x ts_log "Initialize empty image" TEST_IMAGE_NAME=$(ts_image_init 20) # 20 MiB diff --git a/tests/ts/fdisk/oddinput b/tests/ts/fdisk/oddinput index 2120ce7c8..8d512200d 100755 --- a/tests/ts/fdisk/oddinput +++ b/tests/ts/fdisk/oddinput @@ -20,6 +20,8 @@ TS_DESC="invalid input tests" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_FDISK" + #set -x ts_log "Initialize empty image" diff --git a/tests/ts/fdisk/sunlabel b/tests/ts/fdisk/sunlabel index b31ec4f5a..5bfbb4f4c 100755 --- a/tests/ts/fdisk/sunlabel +++ b/tests/ts/fdisk/sunlabel @@ -20,6 +20,8 @@ TS_DESC="sunlabel tests" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_FDISK" + FDISK_CMD_INIT="s\n" # create new sunlabel FDISK_CMD_WRITE_CLOSE="w\nq\n" FDISK_CMD_DELETEALL="d\n1\nd\n2\nd\n3\nd\n4\nd\n5\nd\n6\nd\n7\nd\n8\n" # delete all partitions |