[question kvm-unit-tests] issue about exec

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

 



Hi all,

	I am running kvm-unit-tests, the Bash(version is low) on my server doesn't support the command 'exec', so I changed some codes in kvm-unit-tests.

diff --git a/scripts/functions.bash b/scripts/functions.bash
index f13fe6f..241ae0e 100644
--- a/scripts/functions.bash
+++ b/scripts/functions.bash
@@ -12,9 +12,10 @@ function for_each_unittest()
        local check
        local accel

-       exec {fd}<"$unittests"
+       #exec {fd}<"$unittests"

-       while read -u $fd line; do
+       #while read -u $fd line; do
+       while read line; do
                if [[ "$line" =~ ^\[(.*)\]$ ]]; then
                        "$cmd" "$testname" "$groups" "$smp" "$kernel" "$opts" "$arch" "$check" "$accel"
                        testname=${BASH_REMATCH[1]}
@@ -40,7 +41,7 @@ function for_each_unittest()
                elif [[ $line =~ ^accel\ *=\ *(.*)$ ]]; then
                        accel=${BASH_REMATCH[1]}
                fi
-       done
+       done < $unittests
        "$cmd" "$testname" "$groups" "$smp" "$kernel" "$opts" "$arch" "$check" "$accel"
-       exec {fd}<&-
+       #exec {fd}<&-
 }


     Then, the even unit test will not be executed because the "file" field of unittests.cfg not parsed correctly. Debug info showed as follow:

zyj # Define your new unittest following the convention:
zyj # [unittest_name]
zyj # file = foo.flat # Name of the flat file to be used
zyj # smp = 2 # Number of processors the VM will use during this test
zyj #         # Use $MAX_SMP to use the maximum the host supports.
zyj # extra_params = -cpu qemu64,+x2apic # Additional parameters used
zyj # arch = i386/x86_64 # Only if the test case works only on one of them
zyj # groups = group1 group2 # Used to identify test cases with run_tests -g ...
zyj
zyj [apic]
zyj file = apic.flat
zyj smp = 2
zyj extra_params = -cpu qemu64,+x2apic,+tsc-deadline
zyj arch = x86_64
zyj
zyj [ioapic]
FAIL apic
zyj ile = ioapic.flat     # It got a WRONG LINE here, which should be 'file = **' , but we missed the first character 'f'....
zyj extra_params = -cpu qemu64
zyj arch = x86_64
zyj
zyj [smptest]
qemu-kvm: -kernel -smp: could not open disk image 1: Could not open file: No such file or directory
PASS ioapic
zyj file = smptest.flat  #The read LINE becomes correct after the WRONG one.
zyj smp = 2
zyj
zyj [smptest3]
PASS smptest
zyj ile = smptest.flat  #The LINE becomes incorrect again..
zyj smp = 3
zyj
zyj [vmexit_cpuid]

 I am really confused about this, so is it the right way to read the lines if we have no 'exec' in my bash? and it there any other method to overcome it?

 thanks in advance.

Zhu Yijun



--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux