Re: [PATCH v2] tests: Avoid writing into $HOME during virsh-snapshot

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

 



On Thu, 2019-04-04 at 09:41 -0500, Eric Blake wrote:
> In a constrained CI environment, where it is intentional that attempts
> to write outside the current directory will fail, virsh-snapshot was
> failing:
> 
> @@ -1,2 +1,3 @@
>  error: invalid argument: parent s3 for snapshot s2 not found
>  error: marker
> +error: Failed to create '/home/travis/.cache/libvirt/virsh': Permission denied
> FAIL virsh-snapshot (exit status: 1)
> 
> But we've already solved the problem in virsh-uriprecedence: tell
> virsh to use XDG locations pointing to somewhere we can write rather
> than its default of falling back to $HOME with the test being at risk
> of breaking due to the user's environment and/or unacceptably altering
> the user's normal cache.  Hoist that solution into test-lib.sh, so
> that all scripts can use it as needed. While at it, fix a latent typo
> where XDG_RUNTIME_HOME was set to a literal relative directory name
> "XDG_CACHE_HOME" (the typo did not affect virsh-uriprecedence, but
> could matter to other clients).
> 
> Fixes: 280a2b41
> Fixes: 398de147
> Reported-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
> Signed-off-by: Eric Blake <eblake@xxxxxxxxxx>
> ---
> 
> in v2:
> - fix typo in XDG_RUNTIME_HOME [Andrea]
> - fix 'make distcheck' by using actual per-test tempdir (tests/lv-TEST.XXX/)
> rather than tests/ as the XDG root [Andrea]
> 
>  tests/test-lib.sh         | 13 +++++++++++++
>  tests/virsh-snapshot      |  2 ++
>  tests/virsh-uriprecedence | 12 +-----------
>  3 files changed, 16 insertions(+), 11 deletions(-)

Reviewed-by: Andrea Bolognani <abologna@xxxxxxxxxx>

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux