[pykickstart] Do not set default PE size in pykickstart

Vratislav Podzimek vpodzime at redhat.com
Fri May 16 07:05:09 UTC 2014


On Thu, 2014-05-15 at 13:39 -0400, Chris Lumens wrote:
> > 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.
Well, my intention here was to leave the older tests unmodified. I'd
have to do those changes for both F16_TestCase and FC3_TestCase which
would probably result in more code changed. This way we have the old
test the same and passing without "looking into the future" and the new
test testing the new behaviour.

However, I'm leaving it up to you as a mantainer of pykickstart to
decide which of the ways you think is better.

-- 
Vratislav Podzimek

Anaconda Rider | RHCE | Red Hat, Inc. | Brno - Czech Republic




More information about the anaconda-patches mailing list