diff --git a/libvirt.spec b/libvirt.spec index bc5e82fef3495f9dcd19ddb53f2b77eaf8a5c2a1..0e64f82c1aa610feb85f1a38a72b43b46b37fad1 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -99,7 +99,7 @@ Summary: Library providing a simple virtualization API Name: libvirt Version: 6.2.0 -Release: 13 +Release: 14 License: LGPLv2+ URL: https://libvirt.org/ @@ -164,6 +164,7 @@ Patch0053: qemuDomainDefPostParse-Fail-if-unable-to-fill-machin.patch Patch0054: virNetDevGetFamilyId-Change-signature.patch Patch0055: virNetDevSwitchdevFeature-Make-failure-to-get-family.patch Patch0056: qemuDomainGetUnplugTimeout-Add-G_GNUC_NO_INLINE.patch +Patch0057: tests-commandtest-skip-the-test4-if-the-testcase-is-.patch Requires: libvirt-daemon = %{version}-%{release} Requires: libvirt-daemon-config-network = %{version}-%{release} @@ -1896,6 +1897,9 @@ exit 0 %changelog +* Wed Sep 16 2020 AlexChen +- tests/commandtest: skip the test4 if the testcase is run in the container env + * Tue Sep 22 2020 AlexChen - 6.2.0-13 - bugfix: cherry-pick some bugfix patches from opensource community * Tue Sep 22 2020 Hao Wang - 6.2.0-12 diff --git a/tests-commandtest-skip-the-test4-if-the-testcase-is-.patch b/tests-commandtest-skip-the-test4-if-the-testcase-is-.patch new file mode 100644 index 0000000000000000000000000000000000000000..be63b80f1490e45bd0d8b908adfe3ea8478be724 --- /dev/null +++ b/tests-commandtest-skip-the-test4-if-the-testcase-is-.patch @@ -0,0 +1,47 @@ +From 0b6e5773058e85b8e5e6ce83d3b275726e6883f2 Mon Sep 17 00:00:00 2001 +From: AlexChen +Date: Wed, 16 Sep 2020 15:53:57 +0800 +Subject: [PATCH] tests/commandtest: skip the test4 if the testcase is run in + the container env + +In a container environment without an init thread, the daemoned +process is not reclaimed, and Test4 loops forever, causing +the compilation to hung. So, skip it. + +Signed-off-by: AlexChen +--- + tests/commandtest.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/tests/commandtest.c b/tests/commandtest.c +index d5092b7dd0..ce492e31f7 100644 +--- a/tests/commandtest.c ++++ b/tests/commandtest.c +@@ -259,6 +259,7 @@ static int test4(const void *unused G_GNUC_UNUSED) + char *pidfile = virPidFileBuildPath(abs_builddir, "commandhelper"); + pid_t pid; + int ret = -1; ++ int count = 0; + + if (!pidfile) + goto cleanup; +@@ -275,9 +276,13 @@ static int test4(const void *unused G_GNUC_UNUSED) + printf("cannot read pidfile\n"); + goto cleanup; + } +- while (kill(pid, 0) != -1) +- g_usleep(100*1000); +- ++ while (kill(pid, 0) != -1) { ++ if (count++ >= 600) { ++ printf("check time exceeds 60s, it may be in container env, skip this testcase!!!\n"); ++ break; ++ } ++ g_usleep(100*1000); /* 100 */ ++ } + ret = checkoutput("test4", NULL); + + cleanup: +-- +2.23.0 +