[pykickstart] Do not set default PE size in pykickstart

Chris Lumens clumens at redhat.com
Thu May 15 17:39:24 UTC 2014


> diff --git a/tests/commands/volgroup.py b/tests/commands/volgroup.py
> index 46462a4..1142b9d 100644
> --- a/tests/commands/volgroup.py
> +++ b/tests/commands/volgroup.py
> @@ -57,5 +57,31 @@ class F16_TestCase(FC3_TestCase):
>          self.assert_parse_error("volgroup vg.01 pv.01 --reserved-percent=0", KickstartValueError)
>          self.assert_parse_error("volgroup vg.01 pv.01 --reserved-percent=100", KickstartValueError)
>  
> +class F21_TestCase(F16_TestCase):
> +    def runTest(self):
> +        # cannot run F16_TestCase due to the change of the default PE size
> +        self.assert_parse("volgroup vg.01 pv.01",
> +                          "volgroup vg.01 pv.01\n")

You can avoid the duplication here by changing F16_TestCase to have
something like the following at the top of the runTest method:

    if self.__class__.__name__ == "F16_TestCase":
        pestr = " --pesize=32768"
    else:
        pestr = ""

    self.assert_parse("volgroup vg.01 pv.01 --reserved-space=1000",
                      "volgroup vg.01%s --reserved-space=1000 pv.01\n" % pestr)

Or something like that.  You could also have have an argument to runTest
to tell it whether to add the pesize or not.  There are various
strategies for dealing with this.  See repo.py and partition.py in
particular.

- Chris


More information about the anaconda-patches mailing list