[Libguestfs] [PATCH 3/6] v2v:test:win: actually check the eventual layout
Roman Kagan
rkagan at virtuozzo.com
Mon Oct 5 13:05:54 UTC 2015
On Mon, Oct 05, 2015 at 02:50:52PM +0200, Pino Toscano wrote:
> On Monday 05 October 2015 15:40:03 Roman Kagan wrote:
> > +{
> > guestfish --ro -a $d/windows-sda -i <<EOF
> > + trace 1
> > is-dir "/Program Files/Red Hat/Firstboot"
> > is-file "/Program Files/Red Hat/Firstboot/firstboot.bat"
> > is-dir "/Program Files/Red Hat/Firstboot/scripts"
> > is-dir "/Windows/Drivers/VirtIO"
> > + trace 0
> > EOF
> > +} | {
> > + ret=0
> > + while read r; do
> > + [ "$r" = "true" ] || ret=1
> > + done
> > + exit $ret
> > +}
>
> Note we have tests that check the output of guestfish -- for example,
> fish/test-edit.sh (it is not the only one). I guess you could turn this
> test to do the same, which could be also easier to expand if there will
> be added more commands that output things different than "true".
Yes I have seen it but exactly because I foresee nothing but "true" in
guestfish's output I want to avoid tedious beancounting when maintaining
the expected result string.
> > +(( PIPESTATUS[0] == 0 ))
>
> set -o pipefail (which is bash-specific)
I don't mind this change; want me to resubmit with it?
Roman.
More information about the Libguestfs
mailing list