Re: [libvirt] adding tests....

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

 



"Daniel P. Berrange" <berrange@xxxxxxxxxx> wrote:
>> +    if (remote_config_file == NULL) {
>> +	static const char *default_config_file
>> +	  = SYSCONF_DIR "/libvirt/libvirtd.conf";
>> +	remote_config_file =
>> +	  (access(default_config_file, X_OK) == 0
>> +	   ? default_config_file
>> +	   : "/dev/null");
>> +    }
>
> Indentation looks off-by-2 there.

Good catch.  I had TABs there.
Fixed.

>> +virsh --connect qemu:///session \
>> +    pool-define-as P dir src-host /src/path /src/dev S /target-path > out 2>&1 \
>> +  || fail=1
>> +virsh --connect qemu:///session pool-dumpxml P >> out 2>&1 || fail=1
>
> Using qemu:///session here is fragile because it'll see
> all existing user defined vms/network/storage/etc. Use
> the test:///default  driver instead (or test:///path/to/custom/config.xml)

I wanted to exercise a "real" drivers, not always test://.
How about using an unlikely pool name instead, i.e.,
via this incremental:

diff --git a/tests/libvirtd-pool b/tests/libvirtd-pool
index 72afa12..7ff6cd9 100755
--- a/tests/libvirtd-pool
+++ b/tests/libvirtd-pool
@@ -16,10 +16,12 @@ fail=0
 libvirtd > log 2>&1 & pid=$!
 sleep 1

+P=long-improbable-name-$$-$RANDOM-$PPID
 virsh --connect qemu:///session \
-    pool-define-as P dir src-host /src/path /src/dev S /target-path > out 2>&1 \
+    pool-define-as "$P" dir src-host /src/path /src/dev S /target-path \
+      > out 2>&1 \
   || fail=1
-virsh --connect qemu:///session pool-dumpxml P >> out 2>&1 || fail=1
+virsh --connect qemu:///session pool-dumpxml "$P" >> out 2>&1 || fail=1

 # remove random uuid
 sed 's/<uuid>.*/-/' out > k && mv k out || fail=1

--
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]