aboutsummaryrefslogtreecommitdiff
path: root/test_pbuilder-apt-config
blob: b90aea8a6740363cc7f0af72c18ac3655860cc6e (plain)
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/bin/sh

set -e

. ./testlib.sh

run_suite_mode() {
    ./pbuilder-apt-config --with-sources=no --mirror mirror --suite suite --components component apt-sources "$@"
}

debootstrap_suite() {
    ./pbuilder-apt-config --with-sources=no --mirror mirror --components component debootstrap-suite "$@"
}

debootstrap_mirror() {
    ./pbuilder-apt-config --with-sources=no --components component debootstrap-mirror "$@"
}

test_components() {
    run_suite_mode --components comp1
    run_suite_mode --components comp1,comp2,comp3
    run_suite_mode --components "comp1 comp2 comp3"
}

test_pockets() {
    run_suite_mode --pockets ""
    echo
    run_suite_mode --pockets pocket1
    echo
    run_suite_mode --pockets pocket1,pocket2,pocket3
    echo
    run_suite_mode --pockets "pocket1 pocket2 pocket3"
}

strip_mirror() {
    local deb mirror eol

    while read deb mirror eol; do
        echo "$deb $eol"
    done
}

test_profile() {
    local profile="$1"
    ./pbuilder-apt-config --with-sources=no --profile "$profile" --components comp1 apt-sources | strip_mirror
}

test_fail() {
    exit 1
}

test_options() {
    echo "$@"
    exit 1
}

expect_output "deb mirror suite component" run_suite_mode

expect_output "deb http://archive.ubuntu.com/ubuntu/ lucid component" run_suite_mode --mirror "" --suite lucid --arch i386
expect_output "deb http://ports.ubuntu.com/ubuntu-ports/ lucid component" run_suite_mode --mirror "" --suite lucid --arch armel

expect_output "deb mirror suite comp1
deb mirror suite comp1 comp2 comp3
deb mirror suite comp1 comp2 comp3" test_components

expect_output "deb mirror suite component

deb mirror suite component
deb mirror suite-pocket1 component

deb mirror suite component
deb mirror suite-pocket1 component
deb mirror suite-pocket2 component
deb mirror suite-pocket3 component

deb mirror suite component
deb mirror suite-pocket1 component
deb mirror suite-pocket2 component
deb mirror suite-pocket3 component" test_pockets

expect_output "deb unstable comp1" test_profile unstable
expect_output "deb sid comp1" test_profile sid
expect_output "deb unstable comp1
deb experimental comp1" test_profile experimental
expect_output "deb squeeze comp1
deb squeeze-proposed-updates comp1" test_profile squeeze-proposed-updates
expect_output "deb squeeze comp1
deb squeeze-backports comp1" test_profile squeeze-backports
expect_output "deb squeeze comp1
deb squeeze/volatile comp1" test_profile squeeze/volatile
expect_output "deb squeeze comp1
deb squeeze/volatile comp1
deb squeeze/volatile-sloppy comp1" test_profile squeeze/volatile-sloppy
expect_output "deb bo comp1" test_profile bo

expect_output "deb lucid comp1" test_profile lucid
expect_output "deb lucid comp1
deb lucid-security comp1" test_profile lucid-security
expect_output "deb lucid comp1
deb lucid-security comp1
deb lucid-updates comp1" test_profile lucid-updates
expect_output "deb lucid comp1
deb lucid-security comp1
deb lucid-updates comp1
deb lucid-backports comp1" test_profile lucid-backports
expect_output "deb lucid comp1
deb lucid-security comp1
deb lucid-updates comp1
deb lucid-proposed comp1" test_profile lucid-proposed

expect_output "deb     mirror suite component
deb-src mirror suite component" run_suite_mode --with-sources=yes
expect_output "deb     mirror suite component
deb-src mirror suite component" run_suite_mode --with-sources=
expect_output "deb     mirror suite component
#deb-src mirror suite component" run_suite_mode --with-sources=disabled
expect_output "deb mirror suite component" run_suite_mode --with-sources=no

expect_output "suite" debootstrap_suite --suite suite
expect_output "sid" debootstrap_suite --suite sid
expect_output "sid" debootstrap_suite --suite unstable
expect_output "mirror" debootstrap_mirror --suite suite --mirror mirror

expect_output "sid" debootstrap_suite --profile sid
expect_output "sid" debootstrap_suite --profile unstable
expect_output "http://archive.ubuntu.com/ubuntu/" debootstrap_mirror --profile lucid
expect_output "http://ports.ubuntu.com/ubuntu-ports/" debootstrap_mirror --profile lucid --arch armel

testlib_summary