Add the --nombr bootloader option in pykickstart
[pykickstart.git] / tests / commands / ignoredisk.py
blob361abb53b99126ce5d8dd8b127ff167a0add9d79
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.
21 import unittest
22 from tests.baseclass import *
24 class FC3_TestCase(CommandTest):
25 command = "ignoredisk"
27 def runTest(self):
28 # pass
29 self.assert_parse("ignoredisk --drives=sda", "ignoredisk --drives=sda\n")
30 self.assert_parse("ignoredisk --drives=sda,sdb", "ignoredisk --drives=sda,sdb\n")
32 # fail
33 # wrong option name
34 self.assert_parse_error("ignoredisk --devices=sda", KickstartParseError)
35 # missing arguments
36 self.assert_parse_error("ignoredisk --drives", KickstartParseError)
37 # empty
38 self.assert_parse_error("ignoredisk", KickstartValueError)
40 class F8_TestCase(FC3_TestCase):
41 def runTest(self):
42 # Run parents class tests
43 FC3_TestCase.runTest(self)
45 # pass
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")
51 # fail
52 # missing arguments
53 self.assert_parse_error("ignoredisk --only-use", KickstartParseError)
54 # wrong option name
55 self.assert_parse_error("ignoredisk --devices=sda", KickstartParseError)
56 # missing arguments
57 self.assert_parse_error("ignoredisk --drives", KickstartParseError)
58 # empty
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):
65 def runTest(self):
66 # Run parents class tests
67 F8_TestCase.runTest(self)
69 # pass
70 self.assert_parse("ignoredisk --interactive", "ignoredisk --interactive\n")
72 # fail
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__":
82 unittest.main()