|
|
@@ -2,7 +2,7 @@
|
|
|
* libdpkg - Debian packaging suite library routines
|
|
|
* t-command.c - test command implementation
|
|
|
*
|
|
|
- * Copyright © 2010 Guillem Jover <guillem@debian.org>
|
|
|
+ * Copyright © 2010-2011 Guillem Jover <guillem@debian.org>
|
|
|
*
|
|
|
* This is free software; you can redistribute it and/or modify
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
@@ -152,6 +152,25 @@ test_command_exec(void)
|
|
|
subproc_wait_check(pid, "command exec test", 0);
|
|
|
}
|
|
|
|
|
|
+static void
|
|
|
+test_command_shell(void)
|
|
|
+{
|
|
|
+ pid_t pid;
|
|
|
+ int ret;
|
|
|
+
|
|
|
+ pid = subproc_fork();
|
|
|
+ if (pid == 0)
|
|
|
+ command_shell("true", "command shell pass test");
|
|
|
+ ret = subproc_wait_check(pid, "command shell pass test", 0);
|
|
|
+ test_pass(ret == 0);
|
|
|
+
|
|
|
+ pid = subproc_fork();
|
|
|
+ if (pid == 0)
|
|
|
+ command_shell("false", "command shell fail test");
|
|
|
+ ret = subproc_wait_check(pid, "command shell fail test", PROCNOERR);
|
|
|
+ test_fail(ret == 0);
|
|
|
+}
|
|
|
+
|
|
|
static void
|
|
|
test(void)
|
|
|
{
|
|
|
@@ -160,4 +179,5 @@ test(void)
|
|
|
test_command_add_argl();
|
|
|
test_command_add_args();
|
|
|
test_command_exec();
|
|
|
+ test_command_shell();
|
|
|
}
|