File: test_disk_dvh

package info (click to toggle)
parted 3.2-7
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 15,312 kB
  • ctags: 12,128
  • sloc: ansic: 68,106; sh: 18,156; makefile: 632; perl: 179; python: 45; asm: 36; sed: 16
file content (93 lines) | stat: -rwxr-xr-x 1,686 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#! /bin/bash

test_mklabel()
{
	ped_test "mklabel" "mklabel mips"
}

test_mkpart()
{
	ped_test "mkpart" "mklabel mips mkpart primary ext2 11 20"
}

test_mkpartfs()
{
	ped_test "mkpartfs" "mklabel mips mkpartfs primary ext2 11 20"
}

test_rm()
{
	ped_test "rm" "mklabel mips mkpart primary ext2 10 20 rm 2"
}

test_too_many_primary()
{
	ped_test_expect_fail "too many primary partitions" \
		"mklabel mips \
		 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 mips \
		 mkpart primary ext2 1 100\
		 mkpart primary ext2 50 150"
}

test_nonexistent_remove()
{
	ped_test_expect_fail "removal of non-existent partition"\
		"mklabel mips \
		 rm 2"
}

test_create_small()
{
	ped_test "create small partition"\
		"mklabel mips \
		 mkpartfs primary ext2 1 2"
}

test_move()
{
	ped_test "move partition"\
		"mklabel mips \
		 mkpartfs primary ext2 1 100 \
		 mkpartfs primary ext2 101 200 \
		 move 2 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_small
	test_move
}

main