Re: [PATCH v2 iptables-nft 2/3] extensions: change expected output for new format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 30, 2022 at 09:00:50AM +0100, Florian Westphal wrote:
> Phil Sutter <phil@xxxxxx> wrote:
> > On Tue, Nov 29, 2022 at 03:05:41PM +0100, Florian Westphal wrote:
> > > Now that xtables-translate encloses the entire command line in ', update
> > > the test cases accordingly.
> > 
> > We could also do something like this (untested) and leave the test cases
> > as-is:
> > 
> > diff --git a/xlate-test.py b/xlate-test.py
> > index f3fcd797af908..82999beadb2d6 100755
> > --- a/xlate-test.py
> > +++ b/xlate-test.py
> > @@ -158,9 +158,14 @@ xtables_nft_multi = 'xtables-nft-multi'
> >              sourceline = line.split(';')[0]
> >  
> >          expected = payload.readline().rstrip(" \n")
> > -        next_expected = payload.readline()
> > +        if expected.startswith("nft ") and expected[5] != "'":
> > +                expected = "nft '" + expected.removeprefix("nft ") + "'"
> > +        next_expected = payload.readline().rstrip(" \n")
> >          if next_expected.startswith("nft"):
> > -            expected += "\n" + next_expected.rstrip(" \n")
> > +            if next_expected[5] != "'":
> > +                expected += "\nnft '" + next_expected.removeprefix("nft ") + "'"
> > +            else:
> > +                expected += "\n" + next_expected
> 
> Thats not enough, because the test cases escape ", but the new output
> doesn't do this anymore.

Oh, I forgot! %)
No point in implementing any tricks then.

Thanks, Phil



[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux