diff options
Diffstat (limited to 'debug/test/test_disk_bsd')
-rwxr-xr-x | debug/test/test_disk_bsd | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/debug/test/test_disk_bsd b/debug/test/test_disk_bsd new file mode 100755 index 0000000..9206fae --- /dev/null +++ b/debug/test/test_disk_bsd @@ -0,0 +1,93 @@ +#! /bin/bash + +test_mklabel() +{ + ped_test "mklabel" "mklabel bsd" +} + +test_mkpart() +{ + ped_test "mkpart" "mklabel bsd mkpart primary ext2 10 20" +} + +test_mkpartfs() +{ + ped_test "mkpartfs" "mklabel bsd mkpartfs primary ext2 10 20" +} + +test_rm() +{ + ped_test "rm" "mklabel bsd mkpart primary ext2 10 20 rm 1" +} + +test_too_many_primary() +{ + ped_test_expect_fail "too many primary partitions" \ + "mklabel bsd \ + mkpart primary ext2 10 20 \ + mkpart primary ext2 20 30 \ + mkpart primary ext2 30 40 \ + mkpart primary ext2 40 50 \ + mkpart primary ext2 50 60 \ + mkpart primary ext2 60 70 \ + mkpart primary ext2 70 80 \ + mkpart primary ext2 80 90 \ + mkpart primary ext2 90 100" +} + +test_primary_overlap() +{ + ped_test "correction of partition overlapping"\ + "mklabel bsd \ + mkpart primary ext2 0 100\ + mkpart primary ext2 50 150" +} + +test_nonexistent_remove() +{ + ped_test_expect_fail "removal of non-existent partition"\ + "mklabel bsd \ + rm 1" +} + +test_create_extended() +{ + ped_test_expect_fail "creation of extended partition"\ + "mklabel bsd \ + mkpart extended 0 100" +} + +test_create_small() +{ + ped_test "create small partition"\ + "mklabel bsd \ + mkpartfs primary ext2 1 2" +} + +test_move() +{ + ped_test "move partition"\ + "mklabel bsd \ + mkpartfs primary ext2 0 100 \ + mkpartfs primary ext2 101 200 \ + move 1 201 301" +} + +main() +{ + if ! test_mklabel; then + exit 1 + fi + + test_mkpart + test_mkpartfs + test_rm + test_too_many_primary + test_primary_overlap + test_nonexistent_remove + test_create_extended + test_create_small + test_move +} + +main |