| #! /bin/bash |
| |
| test_mklabel() |
| { |
| ped_test "mklabel" "mklabel pc98" |
| } |
| |
| test_mkpart() |
| { |
| ped_test "mkpart" "mklabel pc98 mkpart primary ext2 10 20" |
| } |
| |
| test_mkpartfs() |
| { |
| ped_test "mkpartfs" "mklabel pc98 mkpartfs primary ext2 10 20" |
| } |
| |
| test_rm() |
| { |
| ped_test "rm" "mklabel pc98 mkpart primary ext2 10 20 rm 1" |
| } |
| |
| test_too_many_primary() |
| { |
| ped_test_expect_fail "too many primary partitions" \ |
| "mklabel pc98 \ |
| 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 \ |
| mkpart primary ext2 100 110 \ |
| mkpart primary ext2 110 120 \ |
| mkpart primary ext2 120 130 \ |
| mkpart primary ext2 130 140 \ |
| mkpart primary ext2 140 150 \ |
| mkpart primary ext2 150 160 \ |
| mkpart primary ext2 160 170 \ |
| mkpart primary ext2 170 180 " |
| } |
| |
| test_primary_overlap() |
| { |
| ped_test "correction of primary partition overlapping"\ |
| "mklabel pc98 \ |
| mkpart primary ext2 0 100\ |
| mkpart primary ext2 50 150" |
| } |
| |
| test_nonexistent_remove() |
| { |
| ped_test_expect_fail "removal of non-existent partition"\ |
| "mklabel pc98 \ |
| rm 1" |
| } |
| |
| test_create_extended() |
| { |
| ped_test_expect_fail "creation of extended partition"\ |
| "mklabel pc98 \ |
| mkpart extended 0 100" |
| } |
| |
| test_create_small() |
| { |
| ped_test "create small partition"\ |
| "mklabel pc98 \ |
| mkpartfs primary ext2 1 2" |
| } |
| |
| test_move() |
| { |
| ped_test "move partition"\ |
| "mklabel pc98 \ |
| mkpartfs primary fat16 0 100 \ |
| mkpartfs primary fat16 100 200 \ |
| move 1 200 300" |
| } |
| |
| 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 |
| |