libvirt/tests/virhostcpudata
Andrea Bolognani 8a743a598b tests: Ensure test files are newline-terminated
Currently we only append a newline to 'actual' if 'expected'
(as loaded from file) already ends in a newline, but that
results in inconsistent behavior.

For example, some of the test files used by virhostcputest are
newline-terminated and some aren't. If we were to remove
existing newlines from those files or add them where they
aren't present, the test would still pass, and even using
VIR_TEST_REGENERATE_OUTPUT=1 wouldn't change them back.

Make things consistent by ensuring that 'actual' is always
newline-terminated. The only exception is when 'actual' is
completely empty: in that case, we want the file to be actually
empty, not contain a single empty line. query-jobs-empty.result
in qemumonitorjsondata/ is an example of this being used.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-01-05 14:38:49 +01:00
..
linux-deconf-cpus
linux-f21-mustang/cpu
linux-high-ids
linux-raspberrypi/cpu
linux-rhel74-moonshot
linux-rhelsa-3.19.0-mustang/cpu
linux-subcores1
linux-subcores2
linux-subcores3
linux-test1
linux-test2
linux-test3
linux-test4
linux-test5/cpu
linux-test6
linux-test7
linux-test8
linux-with-die
linux-with-frequency/cpu
linux-aarch64-f21-mustang.cpuinfo
linux-aarch64-f21-mustang.expected
linux-aarch64-high-ids.cpuinfo
linux-aarch64-high-ids.expected
linux-aarch64-rhel74-moonshot.cpuinfo
linux-aarch64-rhel74-moonshot.expected
linux-aarch64-rhelsa-3.19.0-mustang.cpuinfo
linux-aarch64-rhelsa-3.19.0-mustang.expected
linux-armv6l-raspberrypi.cpuinfo
linux-armv6l-raspberrypi.expected
linux-cpustat-24cpu.out
linux-cpustat-24cpu.stat
linux-ppc64-deconf-cpus.cpuinfo
linux-ppc64-deconf-cpus.expected
linux-ppc64-deconf-cpus.signature
linux-ppc64-subcores1.cpuinfo
linux-ppc64-subcores1.expected
linux-ppc64-subcores1.signature
linux-ppc64-subcores2.cpuinfo
linux-ppc64-subcores2.expected
linux-ppc64-subcores2.signature
linux-ppc64-subcores3.cpuinfo
linux-ppc64-subcores3.expected
linux-ppc64-subcores3.signature
linux-ppc-test1.cpuinfo
linux-ppc-test1.expected
linux-s390x-with-frequency.cpuinfo
linux-s390x-with-frequency.expected
linux-s390x-with-frequency.signature
linux-x86_64-test1.cpuinfo
linux-x86_64-test1.expected
linux-x86_64-test1.signature
linux-x86_64-test2.cpuinfo
linux-x86_64-test2.expected
linux-x86_64-test2.signature
linux-x86_64-test3.cpuinfo
linux-x86_64-test3.expected
linux-x86_64-test3.signature
linux-x86_64-test4.cpuinfo
linux-x86_64-test4.expected
linux-x86_64-test4.signature
linux-x86_64-test5.cpuinfo
linux-x86_64-test5.expected
linux-x86_64-test5.signature
linux-x86_64-test6.cpuinfo
linux-x86_64-test6.expected
linux-x86_64-test6.signature
linux-x86_64-test7.cpuinfo
linux-x86_64-test7.expected
linux-x86_64-test7.signature
linux-x86_64-test8.cpuinfo
linux-x86_64-test8.expected
linux-x86_64-test8.signature
linux-x86_64-with-die.cpuinfo
linux-x86_64-with-die.expected
linux-x86_64-with-die.signature