2 # Chris Lumens <clumens@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 from tests
.baseclass
import *
23 from pykickstart
.errors
import *
25 class FC3_TestCase(CommandTest
):
30 self
.assert_parse("timezone Eastern", "timezone Eastern\n")
32 # On FC6 and later, we write out --isUtc regardless of what the input was.
33 if self
.__class
__.__name
__ == "FC3_TestCase":
34 self
.assert_parse("timezone --utc Eastern", "timezone --utc Eastern\n")
36 self
.assert_parse("timezone --utc Eastern", "timezone --isUtc Eastern\n")
39 self
.assert_parse_error("timezone", KickstartValueError
)
40 self
.assert_parse_error("timezone Eastern Central", KickstartValueError
)
41 self
.assert_parse_error("timezone --blah Eastern")
42 self
.assert_parse_error("timezone --utc", KickstartValueError
)
44 class FC6_TestCase(FC3_TestCase
):
46 FC3_TestCase
.runTest(self
)
49 self
.assert_parse("timezone --isUtc Eastern", "timezone --isUtc Eastern\n")
52 self
.assert_parse_error("timezone --isUtc", KickstartValueError
)
54 class F18_TestCase(FC6_TestCase
):
57 self
.assert_parse("timezone --utc Europe/Prague")
58 self
.assert_parse("timezone --isUtc Europe/Prague\n")
59 self
.assert_parse("timezone --isUtc Eastern", "timezone Eastern --isUtc\n")
60 self
.assert_parse("timezone Europe/Prague")
61 self
.assert_parse("timezone Europe/Prague --nontp",
62 "timezone Europe/Prague --nontp\n")
63 self
.assert_parse("timezone Europe/Prague "\
64 "--ntpservers=ntp.cesnet.cz,tik.nic.cz")
65 self
.assert_parse("timezone Europe/Prague --ntpservers=ntp.cesnet.cz,",
66 "timezone Europe/Prague --ntpservers=ntp.cesnet.cz\n")
69 self
.assert_parse_error("timezone", KickstartValueError
)
70 self
.assert_parse_error("timezone Eastern Central", KickstartValueError
)
71 self
.assert_parse_error("timezone --blah Eastern")
72 self
.assert_parse_error("timezone --utc", KickstartValueError
)
73 self
.assert_parse_error("timezone --isUtc", KickstartValueError
)
74 self
.assert_parse_error("timezone Europe/Prague --nontp "\
75 "--ntpservers=ntp.cesnet.cz",
77 self
.assert_parse_error("timezone Europe/Prague --ntpservers="\
78 "ntp.cesnet.cz, tik.nic.cz",
81 if __name__
== "__main__":