[TCK][PATCH] Remove whitespace differences in network tmp files

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

 



The network/100-apply-verify-host.t test compares the results of various
network commands (route, iptables, ebtables, etc...) against known, valid
results. Depending on the versions of these tools, minor whitespace
differences in command output can result in the failure of the test. This
patch resolves the problem by removing trailing spaces and replacing three
or more concurrent spaces with just two. These changes are only made to
the temporary files involved with the tests.

---
 scripts/networks/networkApplyTest.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/scripts/networks/networkApplyTest.sh b/scripts/networks/networkApplyTest.sh
index 3e93c0a..924130f 100644
--- a/scripts/networks/networkApplyTest.sh
+++ b/scripts/networks/networkApplyTest.sh
@@ -142,6 +142,11 @@ checkExpectedOutput() {
           break
         fi
 
+        # Remove trailing whitespace, replace multiple spaces with just two
+        for file in ${tmpfile} ${tmpfile2}; do
+           sed -i -e 's/ *$//' -e 's/  */  /g' $file
+        done
+
         diff "${tmpfile}" "${tmpfile2}" >/dev/null
 
         if [ $? -ne 0 ]; then
-- 
1.8.4.5

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