Commit fed9a8c split documentation tests

7 files Authored and Committed by bgoncalv a year ago
split documentation tests

    
 1 @@ -38,10 +38,9 @@
 2           TEST_FILE=`mktemp`
 3           TEST_DIR=`mktemp -d`
 4           rlRun "rpm -ql ${PACKAGE} | grep bin/checkmodule"
 5 -         rlRun "rpm -ql ${PACKAGE} | grep /usr/share/man/.*checkmodule"
 6       rlPhaseEnd
 7   
 8 -     rlPhaseStartTest 
 9 +     rlPhaseStartTest
10           rlRun "checkmodule >& ${TEST_FILE}" 1
11           rlAssertGrep "loading policy configuration from policy.conf" ${TEST_FILE}
12           rlRun "checkmodule -b >& ${TEST_FILE}" 1
13 @@ -66,16 +65,13 @@
14           rlRun "checkmodule ${TEST_FILE}" 1
15           rlRun "checkmodule -b ${TEST_FILE}" 1
16           if rlIsRHEL 5 ; then
17 -             rlRun "man checkmodule | col -b | grep -- -d"
18               rlRun "checkmodule --help 2>&1 | grep -- -d"
19           fi
20 -         rlRun "man checkmodule | col -b | grep -- -h"
21 -         rlRun "man checkmodule | col -b | grep -- -U"
22           rlRun "checkmodule --help 2>&1 | grep -- -h"
23           rlRun "checkmodule --help 2>&1 | grep -- -U"
24       rlPhaseEnd
25   
26 -     rlPhaseStartTest 
27 +     rlPhaseStartTest
28           for POLICY_KIND in minimum mls targeted ; do
29               rlRun "checkmodule -M -m -b -o testmod.mod /etc/selinux/${POLICY_KIND}/policy/policy.* >& ${TEST_FILE}" 1
30               rlRun "grep -i \"checkmodule.*-b and -m are incompatible with each other\" ${TEST_FILE}"
 1 @@ -0,0 +1,64 @@
 2 + # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 3 + #
 4 + #   Makefile of /CoreOS/checkpolicy/Sanity/checkpolicy
 5 + #   Description: covers an issue where manpage included an unsupported option.
 6 + #   Author: Milos Malik <mmalik@redhat.com>
 7 + #
 8 + # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 9 + #
10 + #   Copyright (c) 2009 Red Hat, Inc. All rights reserved.
11 + #
12 + #   This copyrighted material is made available to anyone wishing
13 + #   to use, modify, copy, or redistribute it subject to the terms
14 + #   and conditions of the GNU General Public License version 2.
15 + #
16 + #   This program is distributed in the hope that it will be
17 + #   useful, but WITHOUT ANY WARRANTY; without even the implied
18 + #   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
19 + #   PURPOSE. See the GNU General Public License for more details.
20 + #
21 + #   You should have received a copy of the GNU General Public
22 + #   License along with this program; if not, write to the Free
23 + #   Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 + #   Boston, MA 02110-1301, USA.
25 + #
26 + # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27 + 
28 + export TEST=/CoreOS/checkpolicy/Sanity/checkpolicy
29 + export TESTVERSION=1.0
30 + 
31 + BUILT_FILES=
32 + 
33 + FILES=$(METADATA) runtest.sh Makefile PURPOSE
34 + 
35 + .PHONY: all install download clean
36 + 
37 + run: $(FILES) build
38 + »       ./runtest.sh
39 + 
40 + build: $(BUILT_FILES)
41 + »       chmod a+x runtest.sh
42 + 
43 + clean:
44 + »       rm -f *~ $(BUILT_FILES)
45 + 
46 + include /usr/share/rhts/lib/rhts-make.include
47 + 
48 + $(METADATA): Makefile
49 + »       @echo "Owner:           Milos Malik <mmalik@redhat.com>" > $(METADATA)
50 + »       @echo "Name:            $(TEST)" >> $(METADATA)
51 + »       @echo "TestVersion:     $(TESTVERSION)" >> $(METADATA)
52 + »       @echo "Path:            $(TEST_DIR)" >> $(METADATA)
53 + »       @echo "Description:     covers an issue where manpage included an unsupported option." >> $(METADATA)
54 + »       @echo "Type:            Sanity" >> $(METADATA)
55 + »       @echo "TestTime:        1m" >> $(METADATA)
56 + »       @echo "RunFor:          checkpolicy" >> $(METADATA)
57 + »       @echo "Requires:        checkpolicy" >> $(METADATA)
58 + »       @echo "Priority:        Normal" >> $(METADATA)
59 + »       @echo "License:         GPLv2" >> $(METADATA)
60 + »       @echo "Confidential:    no" >> $(METADATA)
61 + »       @echo "Destructive:     no" >> $(METADATA)
62 + »       @echo "Releases:        -RHEL4" >> $(METADATA)
63 + 
64 + »       rhts-lint $(METADATA)
65 + 
1 @@ -0,0 +1,7 @@
2 + PURPOSE of /CoreOS/checkpolicy/Sanity/checkpolicy
3 + 
4 + Description: covers an issue where manpage included an unsupported option.
5 + 
6 + Author: Milos Malik <mmalik@redhat.com>
7 + 
8 + 
 1 @@ -0,0 +1,53 @@
 2 + #!/bin/bash
 3 + # vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
 4 + # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 5 + #
 6 + #   runtest.sh of /CoreOS/checkpolicy/Sanity/checkpolicy-docs
 7 + #   Description: covers an issue where manpage included an unsupported option.
 8 + #   Author: Milos Malik <mmalik@redhat.com>
 9 + #
10 + # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11 + #
12 + #   Copyright (c) 2009 Red Hat, Inc. All rights reserved.
13 + #
14 + #   This copyrighted material is made available to anyone wishing
15 + #   to use, modify, copy, or redistribute it subject to the terms
16 + #   and conditions of the GNU General Public License version 2.
17 + #
18 + #   This program is distributed in the hope that it will be
19 + #   useful, but WITHOUT ANY WARRANTY; without even the implied
20 + #   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
21 + #   PURPOSE. See the GNU General Public License for more details.
22 + #
23 + #   You should have received a copy of the GNU General Public
24 + #   License along with this program; if not, write to the Free
25 + #   Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
26 + #   Boston, MA 02110-1301, USA.
27 + #
28 + # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29 + 
30 + # Include rhts environment
31 + . /usr/bin/rhts-environment.sh
32 + . /usr/share/beakerlib/beakerlib.sh
33 + 
34 + PACKAGE="checkpolicy"
35 + 
36 + rlJournalStart
37 +     rlPhaseStartSetup
38 +         rlAssertRpm ${PACKAGE}
39 +         rlAssertExists "/usr/share/man/man8/checkpolicy.8.gz"
40 +     rlPhaseEnd
41 + 
42 +     rlPhaseStartTest
43 +         rlRun "man checkpolicy | col -b | grep -- '-m]'" 1
44 +         rlRun "rpm -ql ${PACKAGE} | grep /usr/share/man/.*checkmodule"
45 +         if rlIsRHEL 5 ; then
46 +             rlRun "man checkmodule | col -b | grep -- -d"
47 +         fi
48 +         rlRun "man checkmodule | col -b | grep -- -h"
49 +         rlRun "man checkmodule | col -b | grep -- -U"
50 +     rlPhaseEnd
51 + 
52 + rlJournalPrintText
53 + rlJournalEnd
54 + 
1 @@ -4,5 +4,4 @@
2   
3   Author: Milos Malik <mmalik@redhat.com>
4   
5 - This test also covers an issue where manpage included an unsupported option.
6   
 1 @@ -44,7 +44,6 @@
 2           TEST_DIR=`mktemp -d`
 3           OUTPUT_FILE=`mktemp`
 4           rlAssertExists "/usr/bin/checkpolicy"
 5 -         rlAssertExists "/usr/share/man/man8/checkpolicy.8.gz"
 6       rlPhaseEnd
 7   
 8       rlPhaseStartTest "compilation from policy.conf"
 9 @@ -68,7 +67,7 @@
10           done
11       rlPhaseEnd
12   
13 -     rlPhaseStartTest 
14 +     rlPhaseStartTest
15           rlRun "checkpolicy >& ${TEST_FILE}" 1
16           rlAssertGrep "loading policy configuration from policy.conf" ${TEST_FILE}
17           rlRun "checkpolicy -b >& ${TEST_FILE}" 1
18 @@ -99,7 +98,6 @@
19           rlRun "checkpolicy -c 0 2>&1 | grep \"value 0 not in range\""
20           rlRun "checkpolicy -t 2>&1 | grep \"option requires an argument\""
21           rlRun "checkpolicy -t xyz 2>&1 | grep -i \"unknown target platform\""
22 -         rlRun "man checkpolicy | col -b | grep -- '-m]'" 1
23           rlRun "checkpolicy --help 2>&1 | grep -- '-m]'" 1
24       rlPhaseEnd
25   
 1 @@ -1,10 +1,36 @@
 2   ---
 3 - # This first play always runs on the local staging system
 4 + # Tests for Classic
 5   - hosts: localhost
 6     roles:
 7     - role: standard-test-beakerlib
 8       tags:
 9       - classic
10 +     tests:
11 +     - checkmodule
12 +     - checkpolicy
13 +     - checkpolicy-docs
14 +     - sedismod
15 +     - sedispol
16 +     required_packages:
17 +     - checkpolicy              # Required by all tests
18 +     - man                      # Required by checkpolicy-docs
19 +     - grep                     # Required by checkmodule
20 +     - mktemp                   # Required by checkmodule
21 +     - setools-console          # Required by checkpolicy
22 +     - kernel                   # Required by checkpolicy
23 +     - selinux-policy-minimum   # Required by checkpolicy
24 +     - selinux-policy-mls       # Required by checkpolicy
25 +     - selinux-policy-targeted  # Required by checkpolicy and sedismod
26 +     - expect                   # Required by sedismod and sedispol
27 +     - policycoreutils          # Required by sedismod
28 +     - psmisc                   # Required by sedismod
29 +     - selinux-policy           # Required by sedispol
30 + 
31 + # Tests for Container
32 + - hosts: localhost
33 +   roles:
34 +   - role: standard-test-beakerlib
35 +     tags:
36       - container
37       tests:
38       - checkmodule
39 @@ -13,7 +39,6 @@
40       - sedispol
41       required_packages:
42       - checkpolicy              # Required by all tests
43 -     - man                      # Required by checkmodule
44       - grep                     # Required by checkmodule
45       - mktemp                   # Required by checkmodule
46       - setools-console          # Required by checkpolicy