From 387edf547eb09b27ca6d49772eb048d729f09cf4 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 20 Sep 2014 13:09:14 -0500 Subject: Move testsuite out of scripts/test into its own top level tests directory, and make ctrl-c kill "make test" more reliably. --- tests/groupdel.test | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/groupdel.test (limited to 'tests/groupdel.test') diff --git a/tests/groupdel.test b/tests/groupdel.test new file mode 100644 index 00000000..d46db53c --- /dev/null +++ b/tests/groupdel.test @@ -0,0 +1,27 @@ +#!/bin/bash + +# Copyright 2013 Divya Kothari +# Copyright 2013 Robin Mittal + +[ -f testing.sh ] && . testing.sh + +# Redirecting all output to /dev/null for grep and delgroup +arg="&>/dev/null" + +#testing "name" "command" "result" "infile" "stdin" + +testing "groupadd group_name (text)" "groupadd toyTestGroup && + grep '^toyTestGroup:' /etc/group $arg && groupdel toyTestGroup $arg && + echo 'yes'" "yes\n" "" "" +testing "groupadd group_name (alphanumeric)" "groupadd toy1Test2Group3 && + grep '^toy1Test2Group3:' /etc/group $arg && groupdel toy1Test2Group3 $arg && + echo 'yes'" "yes\n" "" "" +testing "groupadd group_name (numeric)" "groupadd 987654321 && + grep '^987654321:' /etc/group $arg && groupdel 987654321 $arg && + echo 'yes'" "yes\n" "" "" +testing "groupadd group_name (with ./-)" "groupadd toy.1Test-2Group.3 && + grep '^toy.1Test-2Group.3:' /etc/group $arg && + groupdel toy.1Test-2Group.3 $arg && echo 'yes'" "yes\n" "" "" +testing "groupadd group_name with group_id" "groupadd -g 49999 toyTestGroup && + grep '^toyTestGroup:' /etc/group $arg && groupdel toyTestGroup $arg && + echo 'yes'" "yes\n" "" "" -- cgit v1.2.3