2 # Martin Gracik <mgracik@redhat.com>
4 # Copyright 2009 Red Hat, Inc.
6 # This copyrighted material is made available to anyone wishing to use, modify,
7 # copy, or redistribute it subject to the terms and conditions of the GNU
8 # General Public License v.2. This program is distributed in the hope that it
9 # will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the
10 # implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 # See the GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License along with
14 # this program; if not, write to the Free Software Foundation, Inc., 51
15 # Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat
16 # trademarks that are incorporated in the source code or documentation are not
17 # subject to the GNU General Public License and may only be used or replicated
18 # with the express permission of Red Hat, Inc.
22 from tests
.baseclass
import *
24 class FC3_TestCase(CommandTest
):
25 command
= "ignoredisk"
29 self
.assert_parse("ignoredisk --drives=sda", "ignoredisk --drives=sda\n")
30 self
.assert_parse("ignoredisk --drives=sda,sdb", "ignoredisk --drives=sda,sdb\n")
34 self
.assert_parse_error("ignoredisk --devices=sda", KickstartParseError
)
36 self
.assert_parse_error("ignoredisk --drives", KickstartParseError
)
38 self
.assert_parse_error("ignoredisk", KickstartValueError
)
40 class F8_TestCase(FC3_TestCase
):
42 # Run parents class tests
43 FC3_TestCase
.runTest(self
)
46 self
.assert_parse("ignoredisk --drives=sda", "ignoredisk --drives=sda\n")
47 self
.assert_parse("ignoredisk --drives=sda,sdb", "ignoredisk --drives=sda,sdb\n")
48 self
.assert_parse("ignoredisk --only-use=sda", "ignoredisk --only-use=sda\n")
49 self
.assert_parse("ignoredisk --only-use=sda,sdb", "ignoredisk --only-use=sda,sdb\n")
53 self
.assert_parse_error("ignoredisk --only-use", KickstartParseError
)
55 self
.assert_parse_error("ignoredisk --devices=sda", KickstartParseError
)
57 self
.assert_parse_error("ignoredisk --drives", KickstartParseError
)
59 self
.assert_parse_error("ignoredisk", KickstartValueError
)
60 # both options provided
61 self
.assert_parse_error("ignoredisk --drives=sda --only-use=sdb", KickstartValueError
)
62 self
.assert_parse_error("ignoredisk --only-use=sda --drives=sdb", KickstartValueError
)
64 class RHEL6_TestCase(F8_TestCase
):
66 # Run parents class tests
67 F8_TestCase
.runTest(self
)
70 self
.assert_parse("ignoredisk --interactive", "ignoredisk --interactive\n")
73 # both options provided
74 self
.assert_parse_error("ignoredisk --drives=sda --interactive", KickstartValueError
)
75 self
.assert_parse_error("ignoredisk --interactive --drives=sda", KickstartValueError
)
76 self
.assert_parse_error("ignoredisk --only-use=sda --interactive", KickstartValueError
)
77 self
.assert_parse_error("ignoredisk --interactive --only-use=sda", KickstartValueError
)
78 self
.assert_parse_error("ignoredisk --interactive --drives=sda --only-use=sdb", KickstartValueError
)
79 self
.assert_parse_error("ignoredisk --only-use=sda --drives=sdb --interactive", KickstartValueError
)
81 if __name__
== "__main__":