diff options
author | Sven Nierlein <sven@nierlein.org> | 2013-01-23 11:43:26 -0800 |
---|---|---|
committer | Sven Nierlein <sven@nierlein.org> | 2013-01-23 11:43:26 -0800 |
commit | 307da669ee8774aee1ac0c21e230f22a59ccb063 (patch) | |
tree | 377d782181ac537314e6c38fc3b298f5db68e7c6 /plugins | |
parent | 596af9df576b0ecf7a7dcc9a2c19ae771f23bf1d (diff) | |
parent | 13e85a0f4f9d1ede624e1135f1646c64ecc052a4 (diff) | |
download | monitoring-plugins-307da669ee8774aee1ac0c21e230f22a59ccb063.tar.gz |
Merge pull request #20 from abradley/aptcritical
Fixes for check_apt handling of -i/-e/-c regexps and SECURITY_RE, plus tests
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/check_apt.c | 56 | ||||
-rw-r--r-- | plugins/t/check_apt.t | 90 | ||||
-rw-r--r-- | plugins/t/check_apt_input/debian1 | 4 | ||||
-rw-r--r-- | plugins/t/check_apt_input/debian2 | 37 | ||||
-rw-r--r-- | plugins/t/check_apt_input/debian3 | 42 | ||||
-rw-r--r-- | plugins/t/check_apt_input/ubuntu1 | 14 | ||||
-rw-r--r-- | plugins/t/check_apt_input/ubuntu2 | 54 |
7 files changed, 276 insertions, 21 deletions
diff --git a/plugins/check_apt.c b/plugins/check_apt.c index 7efa596b..cf186611 100644 --- a/plugins/check_apt.c +++ b/plugins/check_apt.c | |||
@@ -41,6 +41,8 @@ const char *email = "nagiosplug-devel@lists.sourceforge.net"; | |||
41 | /* some constants */ | 41 | /* some constants */ |
42 | typedef enum { UPGRADE, DIST_UPGRADE, NO_UPGRADE } upgrade_type; | 42 | typedef enum { UPGRADE, DIST_UPGRADE, NO_UPGRADE } upgrade_type; |
43 | 43 | ||
44 | /* Character for hidden input file option (for testing). */ | ||
45 | #define INPUT_FILE_OPT CHAR_MAX+1 | ||
44 | /* the default opts can be overridden via the cmdline */ | 46 | /* the default opts can be overridden via the cmdline */ |
45 | #define UPGRADE_DEFAULT_OPTS "-o 'Debug::NoLocking=true' -s -qq" | 47 | #define UPGRADE_DEFAULT_OPTS "-o 'Debug::NoLocking=true' -s -qq" |
46 | #define UPDATE_DEFAULT_OPTS "-q" | 48 | #define UPDATE_DEFAULT_OPTS "-q" |
@@ -49,8 +51,10 @@ typedef enum { UPGRADE, DIST_UPGRADE, NO_UPGRADE } upgrade_type; | |||
49 | #ifndef PATH_TO_APTGET | 51 | #ifndef PATH_TO_APTGET |
50 | # define PATH_TO_APTGET "/usr/bin/apt-get" | 52 | # define PATH_TO_APTGET "/usr/bin/apt-get" |
51 | #endif /* PATH_TO_APTGET */ | 53 | #endif /* PATH_TO_APTGET */ |
54 | /* String found at the beginning of the apt output lines we're interested in */ | ||
55 | #define PKGINST_PREFIX "Inst " | ||
52 | /* the RE that catches security updates */ | 56 | /* the RE that catches security updates */ |
53 | #define SECURITY_RE "^[^\\(]*\\([^ ]* (Debian-Security:|Ubuntu:[^/]*/[^-]*-security)" | 57 | #define SECURITY_RE "^[^\\(]*\\(.* (Debian-Security:|Ubuntu:[^/]*/[^-]*-security)" |
54 | 58 | ||
55 | /* some standard functions */ | 59 | /* some standard functions */ |
56 | int process_arguments(int, char **); | 60 | int process_arguments(int, char **); |
@@ -75,6 +79,7 @@ static char *update_opts = NULL; /* options to override defaults for update */ | |||
75 | static char *do_include = NULL; /* regexp to only include certain packages */ | 79 | static char *do_include = NULL; /* regexp to only include certain packages */ |
76 | static char *do_exclude = NULL; /* regexp to only exclude certain packages */ | 80 | static char *do_exclude = NULL; /* regexp to only exclude certain packages */ |
77 | static char *do_critical = NULL; /* regexp specifying critical packages */ | 81 | static char *do_critical = NULL; /* regexp specifying critical packages */ |
82 | static char *input_filename = NULL; /* input filename for testing */ | ||
78 | 83 | ||
79 | /* other global variables */ | 84 | /* other global variables */ |
80 | static int stderr_warning = 0; /* if a cmd issued output on stderr */ | 85 | static int stderr_warning = 0; /* if a cmd issued output on stderr */ |
@@ -141,6 +146,7 @@ int process_arguments (int argc, char **argv) { | |||
141 | {"include", required_argument, 0, 'i'}, | 146 | {"include", required_argument, 0, 'i'}, |
142 | {"exclude", required_argument, 0, 'e'}, | 147 | {"exclude", required_argument, 0, 'e'}, |
143 | {"critical", required_argument, 0, 'c'}, | 148 | {"critical", required_argument, 0, 'c'}, |
149 | {"input-file", required_argument, 0, INPUT_FILE_OPT}, | ||
144 | {0, 0, 0, 0} | 150 | {0, 0, 0, 0} |
145 | }; | 151 | }; |
146 | 152 | ||
@@ -195,6 +201,9 @@ int process_arguments (int argc, char **argv) { | |||
195 | case 'c': | 201 | case 'c': |
196 | do_critical=add_to_regexp(do_critical, optarg); | 202 | do_critical=add_to_regexp(do_critical, optarg); |
197 | break; | 203 | break; |
204 | case INPUT_FILE_OPT: | ||
205 | input_filename = optarg; | ||
206 | break; | ||
198 | default: | 207 | default: |
199 | /* print short usage statement if args not parsable */ | 208 | /* print short usage statement if args not parsable */ |
200 | usage5(); | 209 | usage5(); |
@@ -211,22 +220,18 @@ int run_upgrade(int *pkgcount, int *secpkgcount){ | |||
211 | struct output chld_out, chld_err; | 220 | struct output chld_out, chld_err; |
212 | regex_t ireg, ereg, sreg; | 221 | regex_t ireg, ereg, sreg; |
213 | char *cmdline=NULL, rerrbuf[64]; | 222 | char *cmdline=NULL, rerrbuf[64]; |
214 | const char *include_ptr=NULL, *crit_ptr=NULL; | ||
215 | 223 | ||
216 | if(upgrade==NO_UPGRADE) return STATE_OK; | 224 | if(upgrade==NO_UPGRADE) return STATE_OK; |
217 | 225 | ||
218 | /* compile the regexps */ | 226 | /* compile the regexps */ |
219 | if(do_include!=NULL) include_ptr=do_include; | 227 | if (do_include != NULL) { |
220 | else include_ptr="^Inst"; | 228 | regres=regcomp(&ireg, do_include, REG_EXTENDED); |
221 | if(do_critical!=NULL) crit_ptr=do_critical; | 229 | if (regres!=0) { |
222 | else crit_ptr=SECURITY_RE; | 230 | regerror(regres, &ireg, rerrbuf, 64); |
223 | 231 | die(STATE_UNKNOWN, _("%s: Error compiling regexp: %s"), progname, rerrbuf); | |
224 | regres=regcomp(&ireg, include_ptr, REG_EXTENDED); | 232 | } |
225 | if(regres!=0) { | ||
226 | regerror(regres, &ireg, rerrbuf, 64); | ||
227 | die(STATE_UNKNOWN, _("%s: Error compiling regexp: %s"), progname, rerrbuf); | ||
228 | } | 233 | } |
229 | 234 | ||
230 | if(do_exclude!=NULL){ | 235 | if(do_exclude!=NULL){ |
231 | regres=regcomp(&ereg, do_exclude, REG_EXTENDED); | 236 | regres=regcomp(&ereg, do_exclude, REG_EXTENDED); |
232 | if(regres!=0) { | 237 | if(regres!=0) { |
@@ -235,6 +240,8 @@ int run_upgrade(int *pkgcount, int *secpkgcount){ | |||
235 | progname, rerrbuf); | 240 | progname, rerrbuf); |
236 | } | 241 | } |
237 | } | 242 | } |
243 | |||
244 | const char *crit_ptr = (do_critical != NULL) ? do_critical : SECURITY_RE; | ||
238 | regres=regcomp(&sreg, crit_ptr, REG_EXTENDED); | 245 | regres=regcomp(&sreg, crit_ptr, REG_EXTENDED); |
239 | if(regres!=0) { | 246 | if(regres!=0) { |
240 | regerror(regres, &ereg, rerrbuf, 64); | 247 | regerror(regres, &ereg, rerrbuf, 64); |
@@ -243,8 +250,14 @@ int run_upgrade(int *pkgcount, int *secpkgcount){ | |||
243 | } | 250 | } |
244 | 251 | ||
245 | cmdline=construct_cmdline(upgrade, upgrade_opts); | 252 | cmdline=construct_cmdline(upgrade, upgrade_opts); |
246 | /* run the upgrade */ | 253 | if (input_filename != NULL) { |
247 | result = np_runcmd(cmdline, &chld_out, &chld_err, 0); | 254 | /* read input from a file for testing */ |
255 | result = cmd_file_read(input_filename, &chld_out, 0); | ||
256 | } else { | ||
257 | /* run the upgrade */ | ||
258 | result = np_runcmd(cmdline, &chld_out, &chld_err, 0); | ||
259 | } | ||
260 | |||
248 | /* apt-get upgrade only changes exit status if there is an | 261 | /* apt-get upgrade only changes exit status if there is an |
249 | * internal error when run in dry-run mode. therefore we will | 262 | * internal error when run in dry-run mode. therefore we will |
250 | * treat such an error as UNKNOWN */ | 263 | * treat such an error as UNKNOWN */ |
@@ -269,7 +282,8 @@ int run_upgrade(int *pkgcount, int *secpkgcount){ | |||
269 | printf("%s\n", chld_out.line[i]); | 282 | printf("%s\n", chld_out.line[i]); |
270 | } | 283 | } |
271 | /* if it is a package we care about */ | 284 | /* if it is a package we care about */ |
272 | if(regexec(&ireg, chld_out.line[i], 0, NULL, 0)==0){ | 285 | if (strncmp(PKGINST_PREFIX, chld_out.line[i], strlen(PKGINST_PREFIX)) == 0 && |
286 | (do_include == NULL || regexec(&ireg, chld_out.line[i], 0, NULL, 0) == 0)) { | ||
273 | /* if we're not excluding, or it's not in the | 287 | /* if we're not excluding, or it's not in the |
274 | * list of stuff to exclude */ | 288 | * list of stuff to exclude */ |
275 | if(do_exclude==NULL || | 289 | if(do_exclude==NULL || |
@@ -289,7 +303,7 @@ int run_upgrade(int *pkgcount, int *secpkgcount){ | |||
289 | *secpkgcount=spc; | 303 | *secpkgcount=spc; |
290 | 304 | ||
291 | /* If we get anything on stderr, at least set warning */ | 305 | /* If we get anything on stderr, at least set warning */ |
292 | if(chld_err.buflen){ | 306 | if (input_filename == NULL && chld_err.buflen) { |
293 | stderr_warning=1; | 307 | stderr_warning=1; |
294 | result = max_state(result, STATE_WARNING); | 308 | result = max_state(result, STATE_WARNING); |
295 | if(verbose){ | 309 | if(verbose){ |
@@ -298,7 +312,7 @@ int run_upgrade(int *pkgcount, int *secpkgcount){ | |||
298 | } | 312 | } |
299 | } | 313 | } |
300 | } | 314 | } |
301 | regfree(&ireg); | 315 | if (do_include != NULL) regfree(&ireg); |
302 | regfree(&sreg); | 316 | regfree(&sreg); |
303 | if(do_exclude!=NULL) regfree(&ereg); | 317 | if(do_exclude!=NULL) regfree(&ereg); |
304 | free(cmdline); | 318 | free(cmdline); |
@@ -348,15 +362,15 @@ char* add_to_regexp(char *expr, const char *next){ | |||
348 | char *re=NULL; | 362 | char *re=NULL; |
349 | 363 | ||
350 | if(expr==NULL){ | 364 | if(expr==NULL){ |
351 | re=malloc(sizeof(char)*(strlen("^Inst () ")+strlen(next)+1)); | 365 | re=malloc(sizeof(char)*(strlen("()")+strlen(next)+1)); |
352 | if(!re) die(STATE_UNKNOWN, "malloc failed!\n"); | 366 | if(!re) die(STATE_UNKNOWN, "malloc failed!\n"); |
353 | sprintf(re, "^Inst (%s) ", next); | 367 | sprintf(re, "(%s)", next); |
354 | } else { | 368 | } else { |
355 | /* resize it, adding an extra char for the new '|' separator */ | 369 | /* resize it, adding an extra char for the new '|' separator */ |
356 | re=realloc(expr, sizeof(char)*strlen(expr)+1+strlen(next)+1); | 370 | re=realloc(expr, sizeof(char)*(strlen(expr)+1+strlen(next)+1)); |
357 | if(!re) die(STATE_UNKNOWN, "realloc failed!\n"); | 371 | if(!re) die(STATE_UNKNOWN, "realloc failed!\n"); |
358 | /* append it starting at ')' in the old re */ | 372 | /* append it starting at ')' in the old re */ |
359 | sprintf((char*)(re+strlen(re)-2), "|%s) ", next); | 373 | sprintf((char*)(re+strlen(re)-1), "|%s)", next); |
360 | } | 374 | } |
361 | 375 | ||
362 | return re; | 376 | return re; |
diff --git a/plugins/t/check_apt.t b/plugins/t/check_apt.t new file mode 100644 index 00000000..71230979 --- /dev/null +++ b/plugins/t/check_apt.t | |||
@@ -0,0 +1,90 @@ | |||
1 | #!/usr/bin/perl -w -I .. | ||
2 | # | ||
3 | # Test check_apt using input files. | ||
4 | # Contributed by Alex Bradley, October 2012 | ||
5 | # | ||
6 | |||
7 | use strict; | ||
8 | use Test::More; | ||
9 | use NPTest; | ||
10 | |||
11 | sub make_result_regexp { | ||
12 | my ($warning, $critical) = @_; | ||
13 | my $status; | ||
14 | if ($warning == 0 && $critical == 0) { | ||
15 | $status = "OK"; | ||
16 | } elsif ($critical == 0) { | ||
17 | $status = "WARNING"; | ||
18 | } else { | ||
19 | $status = "CRITICAL"; | ||
20 | } | ||
21 | return sprintf('/^APT %s: %d packages available for upgrade \(%d critical updates\).\s*$/', | ||
22 | $status, $warning, $critical); | ||
23 | } | ||
24 | |||
25 | if (-x "./check_apt") { | ||
26 | plan tests => 28; | ||
27 | } else { | ||
28 | plan skip_all => "No check_apt compiled"; | ||
29 | } | ||
30 | |||
31 | my $result; | ||
32 | |||
33 | my $testfile_command = "./check_apt %s --input-file=t/check_apt_input/%s"; | ||
34 | |||
35 | $result = NPTest->testCmd( sprintf($testfile_command, "", "debian1") ); | ||
36 | is( $result->return_code, 0, "No upgrades" ); | ||
37 | like( $result->output, make_result_regexp(0, 0), "Output correct" ); | ||
38 | |||
39 | $result = NPTest->testCmd( sprintf($testfile_command, "", "debian2") ); | ||
40 | is( $result->return_code, 1, "Debian apt output, warning" ); | ||
41 | like( $result->output, make_result_regexp(13, 0), "Output correct" ); | ||
42 | |||
43 | $result = NPTest->testCmd( sprintf($testfile_command, "", "debian3") ); | ||
44 | is( $result->return_code, 2, "Debian apt output, some critical" ); | ||
45 | like( $result->output, make_result_regexp(19, 4), "Output correct" ); | ||
46 | |||
47 | $result = NPTest->testCmd( sprintf($testfile_command, "-c '^[^\\(]*\\(.* (Debian-Security:|Ubuntu:[^/]*/[^-]*-security)'", "debian3") ); | ||
48 | is( $result->return_code, 2, "Debian apt output - should have same result when default security regexp specified via -c" ); | ||
49 | like( $result->output, make_result_regexp(19, 4), "Output correct" ); | ||
50 | |||
51 | $result = NPTest->testCmd( sprintf($testfile_command, "-i libc6", "debian3") ); | ||
52 | is( $result->return_code, 1, "Debian apt output, filter for libc6" ); | ||
53 | like( $result->output, make_result_regexp(3, 0), "Output correct" ); | ||
54 | |||
55 | $result = NPTest->testCmd( sprintf($testfile_command, "-i libc6 -i xen", "debian3") ); | ||
56 | is( $result->return_code, 2, "Debian apt output, filter for libc6 and xen" ); | ||
57 | like( $result->output, make_result_regexp(9, 4), "Output correct" ); | ||
58 | |||
59 | $result = NPTest->testCmd( sprintf($testfile_command, "-i libc6 -i xen -i linux", "debian3") ); | ||
60 | is( $result->return_code, 2, "Debian apt output, filter for libc6, xen, linux" ); | ||
61 | like( $result->output, make_result_regexp(12, 4), "Output correct" ); | ||
62 | |||
63 | $result = NPTest->testCmd( sprintf($testfile_command, "-e libc6", "debian3") ); | ||
64 | is( $result->return_code, 2, "Debian apt output, filter out libc6" ); | ||
65 | like( $result->output, make_result_regexp(16, 4), "Output correct" ); | ||
66 | |||
67 | $result = NPTest->testCmd( sprintf($testfile_command, "-e libc6 -e xen", "debian3") ); | ||
68 | is( $result->return_code, 1, "Debian apt output, filter out libc6 and xen" ); | ||
69 | like( $result->output, make_result_regexp(10, 0), "Output correct" ); | ||
70 | |||
71 | $result = NPTest->testCmd( sprintf($testfile_command, "-e libc6 -e xen -e linux", "debian3") ); | ||
72 | is( $result->return_code, 1, "Debian apt output, filter out libc6, xen, linux" ); | ||
73 | like( $result->output, make_result_regexp(7, 0), "Output correct" ); | ||
74 | |||
75 | $result = NPTest->testCmd( sprintf($testfile_command, "-c Debian-Security -c linux", "debian3") ); | ||
76 | is( $result->return_code, 2, "Debian apt output, critical on Debian-Security or linux" ); | ||
77 | like( $result->output, make_result_regexp(19, 9), "Output correct" ); | ||
78 | |||
79 | $result = NPTest->testCmd( sprintf($testfile_command, "-i lib -i linux -e gc1c -c linux-image", "debian3") ); | ||
80 | is( $result->return_code, 2, "Debian apt output, include lib and linux, exclude gc1c, critical on linux-image" ); | ||
81 | like( $result->output, make_result_regexp(10, 2), "Output correct" ); | ||
82 | |||
83 | $result = NPTest->testCmd( sprintf($testfile_command, "", "ubuntu1") ); | ||
84 | is( $result->return_code, 1, "Ubuntu apt output, warning" ); | ||
85 | like( $result->output, make_result_regexp(5, 0), "Output correct" ); | ||
86 | |||
87 | $result = NPTest->testCmd( sprintf($testfile_command, "", "ubuntu2") ); | ||
88 | is( $result->return_code, 2, "Ubuntu apt output, some critical" ); | ||
89 | like( $result->output, make_result_regexp(25, 14), "Output correct" ); | ||
90 | |||
diff --git a/plugins/t/check_apt_input/debian1 b/plugins/t/check_apt_input/debian1 new file mode 100644 index 00000000..317e7ea7 --- /dev/null +++ b/plugins/t/check_apt_input/debian1 | |||
@@ -0,0 +1,4 @@ | |||
1 | NOTE: This is only a simulation! | ||
2 | apt-get needs root privileges for real execution. | ||
3 | Keep also in mind that locking is deactivated, | ||
4 | so don't depend on the relevance to the real current situation! | ||
diff --git a/plugins/t/check_apt_input/debian2 b/plugins/t/check_apt_input/debian2 new file mode 100644 index 00000000..effd1553 --- /dev/null +++ b/plugins/t/check_apt_input/debian2 | |||
@@ -0,0 +1,37 @@ | |||
1 | NOTE: This is only a simulation! | ||
2 | apt-get needs root privileges for real execution. | ||
3 | Keep also in mind that locking is deactivated, | ||
4 | so don't depend on the relevance to the real current situation! | ||
5 | Reading package lists... Done | ||
6 | Building dependency tree | ||
7 | Reading state information... Done | ||
8 | The following packages will be upgraded: | ||
9 | base-files debian-archive-keyring dpkg firmware-linux-free libc-bin libc-dev-bin libc6 libc6-dev linux-base | ||
10 | linux-image-2.6.32-5-xen-amd64 linux-libc-dev locales lockfile-progs | ||
11 | 13 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. | ||
12 | Inst base-files [6.0squeeze5] (6.0squeeze6 Debian:6.0.6/stable [amd64]) | ||
13 | Conf base-files (6.0squeeze6 Debian:6.0.6/stable [amd64]) | ||
14 | Inst dpkg [1.15.8.12] (1.15.8.13 Debian:6.0.6/stable [amd64]) | ||
15 | Conf dpkg (1.15.8.13 Debian:6.0.6/stable [amd64]) | ||
16 | Inst linux-base [2.6.32-45] (2.6.32-46 Debian:6.0.6/stable [all]) | ||
17 | Inst linux-image-2.6.32-5-xen-amd64 [2.6.32-45] (2.6.32-46 Debian:6.0.6/stable [amd64]) | ||
18 | Inst debian-archive-keyring [2010.08.28] (2010.08.28+squeeze1 Debian:6.0.6/stable [all]) | ||
19 | Conf debian-archive-keyring (2010.08.28+squeeze1 Debian:6.0.6/stable [all]) | ||
20 | Inst libc6-dev [2.11.3-3] (2.11.3-4 Debian:6.0.6/stable [amd64]) [] | ||
21 | Inst libc-dev-bin [2.11.3-3] (2.11.3-4 Debian:6.0.6/stable [amd64]) [] | ||
22 | Inst linux-libc-dev [2.6.32-45] (2.6.32-46 Debian:6.0.6/stable [amd64]) [] | ||
23 | Inst libc-bin [2.11.3-3] (2.11.3-4 Debian:6.0.6/stable [amd64]) [libc6:amd64 ] | ||
24 | Conf libc-bin (2.11.3-4 Debian:6.0.6/stable [amd64]) [libc6:amd64 ] | ||
25 | Inst libc6 [2.11.3-3] (2.11.3-4 Debian:6.0.6/stable [amd64]) | ||
26 | Conf libc6 (2.11.3-4 Debian:6.0.6/stable [amd64]) | ||
27 | Inst locales [2.11.3-3] (2.11.3-4 Debian:6.0.6/stable [all]) | ||
28 | Inst firmware-linux-free [2.6.32-45] (2.6.32-46 Debian:6.0.6/stable [all]) | ||
29 | Inst lockfile-progs [0.1.15] (0.1.15+squeeze1 Debian:6.0.6/stable [amd64]) | ||
30 | Conf linux-base (2.6.32-46 Debian:6.0.6/stable [all]) | ||
31 | Conf linux-image-2.6.32-5-xen-amd64 (2.6.32-46 Debian:6.0.6/stable [amd64]) | ||
32 | Conf libc-dev-bin (2.11.3-4 Debian:6.0.6/stable [amd64]) | ||
33 | Conf linux-libc-dev (2.6.32-46 Debian:6.0.6/stable [amd64]) | ||
34 | Conf libc6-dev (2.11.3-4 Debian:6.0.6/stable [amd64]) | ||
35 | Conf locales (2.11.3-4 Debian:6.0.6/stable [all]) | ||
36 | Conf firmware-linux-free (2.6.32-46 Debian:6.0.6/stable [all]) | ||
37 | Conf lockfile-progs (0.1.15+squeeze1 Debian:6.0.6/stable [amd64]) | ||
diff --git a/plugins/t/check_apt_input/debian3 b/plugins/t/check_apt_input/debian3 new file mode 100644 index 00000000..719dce9b --- /dev/null +++ b/plugins/t/check_apt_input/debian3 | |||
@@ -0,0 +1,42 @@ | |||
1 | NOTE: This is only a simulation! | ||
2 | apt-get needs root privileges for real execution. | ||
3 | Keep also in mind that locking is deactivated, | ||
4 | so don't depend on the relevance to the real current situation! | ||
5 | Inst base-files [6.0squeeze5] (6.0squeeze6 Debian:6.0.6/stable [amd64]) | ||
6 | Conf base-files (6.0squeeze6 Debian:6.0.6/stable [amd64]) | ||
7 | Inst dpkg [1.15.8.12] (1.15.8.13 Debian:6.0.6/stable [amd64]) | ||
8 | Conf dpkg (1.15.8.13 Debian:6.0.6/stable [amd64]) | ||
9 | Inst linux-base [2.6.32-45] (2.6.32-46 Debian:6.0.6/stable [all]) | ||
10 | Inst linux-image-2.6.32-5-amd64 [2.6.32-45] (2.6.32-46 Debian:6.0.6/stable [amd64]) | ||
11 | Inst xen-hypervisor-4.0-amd64 [4.0.1-5.3] (4.0.1-5.4 Debian:6.0.6/stable, Debian-Security:6.0/stable [amd64]) | ||
12 | Inst xen-linux-system-2.6.32-5-xen-amd64 [2.6.32-45] (2.6.32-46 Debian:6.0.6/stable [amd64]) [] | ||
13 | Inst linux-image-2.6.32-5-xen-amd64 [2.6.32-45] (2.6.32-46 Debian:6.0.6/stable [amd64]) | ||
14 | Inst debian-archive-keyring [2010.08.28] (2010.08.28+squeeze1 Debian:6.0.6/stable [all]) | ||
15 | Conf debian-archive-keyring (2010.08.28+squeeze1 Debian:6.0.6/stable [all]) | ||
16 | Inst libc6-i386 [2.11.3-3] (2.11.3-4 Debian:6.0.6/stable [amd64]) [] | ||
17 | Inst libc-bin [2.11.3-3] (2.11.3-4 Debian:6.0.6/stable [amd64]) [libc6:amd64 ] | ||
18 | Conf libc-bin (2.11.3-4 Debian:6.0.6/stable [amd64]) [libc6:amd64 ] | ||
19 | Inst libc6 [2.11.3-3] (2.11.3-4 Debian:6.0.6/stable [amd64]) | ||
20 | Conf libc6 (2.11.3-4 Debian:6.0.6/stable [amd64]) | ||
21 | Inst libgc1c2 [1:6.8-1.2] (1:6.8-2 Debian:6.0.6/stable [amd64]) | ||
22 | Inst locales [2.11.3-3] (2.11.3-4 Debian:6.0.6/stable [all]) | ||
23 | Inst firmware-linux-free [2.6.32-45] (2.6.32-46 Debian:6.0.6/stable [all]) | ||
24 | Inst libxenstore3.0 [4.0.1-5.3] (4.0.1-5.4 Debian:6.0.6/stable, Debian-Security:6.0/stable [amd64]) | ||
25 | Inst lockfile-progs [0.1.15] (0.1.15+squeeze1 Debian:6.0.6/stable [amd64]) | ||
26 | Inst xen-utils-4.0 [4.0.1-5.3] (4.0.1-5.4 Debian:6.0.6/stable, Debian-Security:6.0/stable [amd64]) | ||
27 | Inst xenstore-utils [4.0.1-5.3] (4.0.1-5.4 Debian:6.0.6/stable, Debian-Security:6.0/stable [amd64]) | ||
28 | Inst libconfig-inifiles-perl [2.52-1] (2.52-1+squeeze1 Debian:6.0.6/stable [all]) | ||
29 | Conf linux-base (2.6.32-46 Debian:6.0.6/stable [all]) | ||
30 | Conf linux-image-2.6.32-5-amd64 (2.6.32-46 Debian:6.0.6/stable [amd64]) | ||
31 | Conf xen-hypervisor-4.0-amd64 (4.0.1-5.4 Debian:6.0.6/stable, Debian-Security:6.0/stable [amd64]) | ||
32 | Conf linux-image-2.6.32-5-xen-amd64 (2.6.32-46 Debian:6.0.6/stable [amd64]) | ||
33 | Conf xen-linux-system-2.6.32-5-xen-amd64 (2.6.32-46 Debian:6.0.6/stable [amd64]) | ||
34 | Conf libc6-i386 (2.11.3-4 Debian:6.0.6/stable [amd64]) | ||
35 | Conf libgc1c2 (1:6.8-2 Debian:6.0.6/stable [amd64]) | ||
36 | Conf locales (2.11.3-4 Debian:6.0.6/stable [all]) | ||
37 | Conf firmware-linux-free (2.6.32-46 Debian:6.0.6/stable [all]) | ||
38 | Conf libxenstore3.0 (4.0.1-5.4 Debian:6.0.6/stable, Debian-Security:6.0/stable [amd64]) | ||
39 | Conf lockfile-progs (0.1.15+squeeze1 Debian:6.0.6/stable [amd64]) | ||
40 | Conf xen-utils-4.0 (4.0.1-5.4 Debian:6.0.6/stable, Debian-Security:6.0/stable [amd64]) | ||
41 | Conf xenstore-utils (4.0.1-5.4 Debian:6.0.6/stable, Debian-Security:6.0/stable [amd64]) | ||
42 | Conf libconfig-inifiles-perl (2.52-1+squeeze1 Debian:6.0.6/stable [all]) | ||
diff --git a/plugins/t/check_apt_input/ubuntu1 b/plugins/t/check_apt_input/ubuntu1 new file mode 100644 index 00000000..2f61c30e --- /dev/null +++ b/plugins/t/check_apt_input/ubuntu1 | |||
@@ -0,0 +1,14 @@ | |||
1 | NOTE: This is only a simulation! | ||
2 | apt-get needs root privileges for real execution. | ||
3 | Also keep in mind that locking is deactivated, | ||
4 | so don't depend on the relevance to the real current situation! | ||
5 | Inst grub-pc [1.99-21ubuntu3.1] (1.99-21ubuntu3.4 Ubuntu:12.04/precise-updates [amd64]) [] | ||
6 | Inst grub-pc-bin [1.99-21ubuntu3.1] (1.99-21ubuntu3.4 Ubuntu:12.04/precise-updates [amd64]) [] | ||
7 | Inst grub2-common [1.99-21ubuntu3.1] (1.99-21ubuntu3.4 Ubuntu:12.04/precise-updates [amd64]) [] | ||
8 | Inst grub-efi-amd64-bin [1.99-21ubuntu3.1] (1.99-21ubuntu3.4 Ubuntu:12.04/precise-updates [amd64]) [] | ||
9 | Inst grub-common [1.99-21ubuntu3.1] (1.99-21ubuntu3.4 Ubuntu:12.04/precise-updates [amd64]) | ||
10 | Conf grub-common (1.99-21ubuntu3.4 Ubuntu:12.04/precise-updates [amd64]) | ||
11 | Conf grub2-common (1.99-21ubuntu3.4 Ubuntu:12.04/precise-updates [amd64]) | ||
12 | Conf grub-pc-bin (1.99-21ubuntu3.4 Ubuntu:12.04/precise-updates [amd64]) | ||
13 | Conf grub-pc (1.99-21ubuntu3.4 Ubuntu:12.04/precise-updates [amd64]) | ||
14 | Conf grub-efi-amd64-bin (1.99-21ubuntu3.4 Ubuntu:12.04/precise-updates [amd64]) | ||
diff --git a/plugins/t/check_apt_input/ubuntu2 b/plugins/t/check_apt_input/ubuntu2 new file mode 100644 index 00000000..29a14a02 --- /dev/null +++ b/plugins/t/check_apt_input/ubuntu2 | |||
@@ -0,0 +1,54 @@ | |||
1 | NOTE: This is only a simulation! | ||
2 | apt-get needs root privileges for real execution. | ||
3 | Also keep in mind that locking is deactivated, | ||
4 | so don't depend on the relevance to the real current situation! | ||
5 | Inst libc6-dev [2.15-0ubuntu10] (2.15-0ubuntu10.2 Ubuntu:12.04/precise-security [amd64]) [] | ||
6 | Inst libc-dev-bin [2.15-0ubuntu10] (2.15-0ubuntu10.2 Ubuntu:12.04/precise-security [amd64]) [] | ||
7 | Inst linux-libc-dev [3.2.0-29.46] (3.2.0-31.50 Ubuntu:12.04/precise-security [amd64]) [] | ||
8 | Inst tzdata [2012e-0ubuntu0.12.04] (2012e-0ubuntu0.12.04.1 Ubuntu:12.04/precise-security [all]) [] | ||
9 | Conf tzdata (2012e-0ubuntu0.12.04.1 Ubuntu:12.04/precise-security [all]) [] | ||
10 | Inst libc-bin [2.15-0ubuntu10] (2.15-0ubuntu10.2 Ubuntu:12.04/precise-security [amd64]) [libc6:amd64 ] | ||
11 | Conf libc-bin (2.15-0ubuntu10.2 Ubuntu:12.04/precise-security [amd64]) [libc6:amd64 ] | ||
12 | Inst libc6 [2.15-0ubuntu10] (2.15-0ubuntu10.2 Ubuntu:12.04/precise-security [amd64]) | ||
13 | Conf libc6 (2.15-0ubuntu10.2 Ubuntu:12.04/precise-security [amd64]) | ||
14 | Inst libapt-pkg4.12 [0.8.16~exp12ubuntu10.2] (0.8.16~exp12ubuntu10.3 Ubuntu:12.04/precise-updates [amd64]) | ||
15 | Conf libapt-pkg4.12 (0.8.16~exp12ubuntu10.3 Ubuntu:12.04/precise-updates [amd64]) | ||
16 | Inst ubuntu-keyring [2011.11.21] (2011.11.21.1 Ubuntu:12.04/precise-updates [all]) | ||
17 | Conf ubuntu-keyring (2011.11.21.1 Ubuntu:12.04/precise-updates [all]) | ||
18 | Inst gpgv [1.4.11-3ubuntu2] (1.4.11-3ubuntu2.1 Ubuntu:12.04/precise-security [amd64]) | ||
19 | Conf gpgv (1.4.11-3ubuntu2.1 Ubuntu:12.04/precise-security [amd64]) | ||
20 | Inst gnupg [1.4.11-3ubuntu2] (1.4.11-3ubuntu2.1 Ubuntu:12.04/precise-security [amd64]) | ||
21 | Conf gnupg (1.4.11-3ubuntu2.1 Ubuntu:12.04/precise-security [amd64]) | ||
22 | Inst apt [0.8.16~exp12ubuntu10.2] (0.8.16~exp12ubuntu10.3 Ubuntu:12.04/precise-updates [amd64]) | ||
23 | Conf apt (0.8.16~exp12ubuntu10.3 Ubuntu:12.04/precise-updates [amd64]) | ||
24 | Inst libssl1.0.0 [1.0.1-4ubuntu5.3] (1.0.1-4ubuntu5.5 Ubuntu:12.04/precise-updates [amd64]) | ||
25 | Conf libssl1.0.0 (1.0.1-4ubuntu5.5 Ubuntu:12.04/precise-updates [amd64]) | ||
26 | Inst libapt-inst1.4 [0.8.16~exp12ubuntu10.2] (0.8.16~exp12ubuntu10.3 Ubuntu:12.04/precise-updates [amd64]) | ||
27 | Inst resolvconf [1.63ubuntu15] (1.63ubuntu16 Ubuntu:12.04/precise-updates [all]) | ||
28 | Inst libdbus-1-3 [1.4.18-1ubuntu1] (1.4.18-1ubuntu1.1 Ubuntu:12.04/precise-security [amd64]) | ||
29 | Inst libxml2 [2.7.8.dfsg-5.1ubuntu4.1] (2.7.8.dfsg-5.1ubuntu4.2 Ubuntu:12.04/precise-security [amd64]) | ||
30 | Inst multiarch-support [2.15-0ubuntu10] (2.15-0ubuntu10.2 Ubuntu:12.04/precise-security [amd64]) | ||
31 | Conf multiarch-support (2.15-0ubuntu10.2 Ubuntu:12.04/precise-security [amd64]) | ||
32 | Inst apt-utils [0.8.16~exp12ubuntu10.2] (0.8.16~exp12ubuntu10.3 Ubuntu:12.04/precise-updates [amd64]) | ||
33 | Inst isc-dhcp-client [4.1.ESV-R4-0ubuntu5.2] (4.1.ESV-R4-0ubuntu5.5 Ubuntu:12.04/precise-security [amd64]) [] | ||
34 | Inst isc-dhcp-common [4.1.ESV-R4-0ubuntu5.2] (4.1.ESV-R4-0ubuntu5.5 Ubuntu:12.04/precise-security [amd64]) | ||
35 | Inst dbus [1.4.18-1ubuntu1] (1.4.18-1ubuntu1.1 Ubuntu:12.04/precise-security [amd64]) | ||
36 | Inst linux-firmware [1.79] (1.79.1 Ubuntu:12.04/precise-updates [all]) | ||
37 | Inst xserver-common [2:1.11.4-0ubuntu10.7] (2:1.11.4-0ubuntu10.8 Ubuntu:12.04/precise-updates [all]) | ||
38 | Inst xserver-xorg-core [2:1.11.4-0ubuntu10.7] (2:1.11.4-0ubuntu10.8 Ubuntu:12.04/precise-updates [amd64]) | ||
39 | Inst xserver-xorg-input-synaptics [1.6.2-1ubuntu1~precise1] (1.6.2-1ubuntu1~precise2 Ubuntu:12.04/precise-updates [amd64]) | ||
40 | Conf libc-dev-bin (2.15-0ubuntu10.2 Ubuntu:12.04/precise-security [amd64]) | ||
41 | Conf linux-libc-dev (3.2.0-31.50 Ubuntu:12.04/precise-security [amd64]) | ||
42 | Conf libc6-dev (2.15-0ubuntu10.2 Ubuntu:12.04/precise-security [amd64]) | ||
43 | Conf libapt-inst1.4 (0.8.16~exp12ubuntu10.3 Ubuntu:12.04/precise-updates [amd64]) | ||
44 | Conf resolvconf (1.63ubuntu16 Ubuntu:12.04/precise-updates [all]) | ||
45 | Conf libdbus-1-3 (1.4.18-1ubuntu1.1 Ubuntu:12.04/precise-security [amd64]) | ||
46 | Conf libxml2 (2.7.8.dfsg-5.1ubuntu4.2 Ubuntu:12.04/precise-security [amd64]) | ||
47 | Conf apt-utils (0.8.16~exp12ubuntu10.3 Ubuntu:12.04/precise-updates [amd64]) | ||
48 | Conf isc-dhcp-common (4.1.ESV-R4-0ubuntu5.5 Ubuntu:12.04/precise-security [amd64]) | ||
49 | Conf isc-dhcp-client (4.1.ESV-R4-0ubuntu5.5 Ubuntu:12.04/precise-security [amd64]) | ||
50 | Conf dbus (1.4.18-1ubuntu1.1 Ubuntu:12.04/precise-security [amd64]) | ||
51 | Conf linux-firmware (1.79.1 Ubuntu:12.04/precise-updates [all]) | ||
52 | Conf xserver-common (2:1.11.4-0ubuntu10.8 Ubuntu:12.04/precise-updates [all]) | ||
53 | Conf xserver-xorg-core (2:1.11.4-0ubuntu10.8 Ubuntu:12.04/precise-updates [amd64]) | ||
54 | Conf xserver-xorg-input-synaptics (1.6.2-1ubuntu1~precise2 Ubuntu:12.04/precise-updates [amd64]) | ||