[libvirt] int-overflow test fails if /root is not writable and /root/.virsh does not exist yet

--- err 2011-03-18 00:07:36.000000000 +0100 +++ exp 2011-03-18 00:07:36.000000000 +0100 @@ -1,2 +1 @@ error: failed to get domain '4294967298' -error: Failed to create '/root/.virsh': Permission denied FAIL: int-overflow This has been reported in Gentoo: https://bugs.gentoo.org/show_bug.cgi?id=359307 I guess it is worth looking at and fix it not to fail in this case? Thanks, -- Diego Elio Pettenò — Flameeyes http://blog.flameeyes.eu/

On 03/17/2011 05:43 PM, Diego Elio Pettenò wrote:
--- err 2011-03-18 00:07:36.000000000 +0100 +++ exp 2011-03-18 00:07:36.000000000 +0100 @@ -1,2 +1 @@ error: failed to get domain '4294967298' -error: Failed to create '/root/.virsh': Permission denied FAIL: int-overflow
This has been reported in Gentoo: https://bugs.gentoo.org/show_bug.cgi?id=359307
I guess it is worth looking at and fix it not to fail in this case?
Creation of $HOME/.virsh should only happen in interactive mode (when compiled with readline support); I'm not sure why this test is triggering that, because there shouldn't be any interactive testing going on in the test suite. I'm looking into it now. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

Diego reported a bug where virsh tries to initialize a readline history directory during 'make check' run as root, but fails because /root was read-only. It turns out that I could reproduce this as non-root, by using: mv ~/.virsh{,.bak} chmod a-w ~ make check -C tests TESTS=int-overflow chmod u+w ~ mv ~/.virsh{.bak,} * tests/int-overflow: Don't trigger interactive mode. Reported by Diego Elio Pettenò. --- Found it. virsh without non-option arguments is interactive and triggers readline shenanigans; change from echoing into an interactive session into running a non-interactive batch session. tests/int-overflow | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/int-overflow b/tests/int-overflow index c9f5de9..baf2eef 100755 --- a/tests/int-overflow +++ b/tests/int-overflow @@ -14,9 +14,9 @@ fi . "$srcdir/test-lib.sh" echo "error: failed to get domain '4294967298'" > exp || fail=1 -echo domname 4294967298 | $abs_top_builddir/tools/virsh --quiet \ +$abs_top_builddir/tools/virsh --quiet \ --connect test://$abs_top_srcdir/examples/xml/test/testnode.xml \ - > /dev/null 2> err || fail=1 + 'domname 4294967298; quit' > /dev/null 2> err || fail=1 diff -u err exp || fail=1 exit $fail -- 1.7.4
participants (2)
-
Diego Elio Pettenò
-
Eric Blake