From e5a2c24219c978b7fa707d54a5f90ca1549e90f3 Mon Sep 17 00:00:00 2001 From: AlexChen Date: Wed, 16 Sep 2020 15:53:57 +0800 Subject: [PATCH 1/3] 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 --- ...t-skip-the-test4-if-the-testcase-is-.patch | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 tests-commandtest-skip-the-test4-if-the-testcase-is-.patch 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 0000000..be63b80 --- /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 + -- Gitee From 2744c9a4a77d02aab3b2e022dff1f619e4845e07 Mon Sep 17 00:00:00 2001 From: Euler Robot Date: Wed, 23 Sep 2020 11:29:17 +0800 Subject: [PATCH 2/3] spec: Update patch and changelog with !2 tests/commandtest: skip the test4 if the testcase is run in the container env Signed-off-by: AlexChen --- libvirt.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libvirt.spec b/libvirt.spec index bc5e82f..4112a62 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -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 -- Gitee From 54a999f86f668e1e894be2c508d68fa2557b5461 Mon Sep 17 00:00:00 2001 From: Euler Robot Date: Wed, 23 Sep 2020 11:29:17 +0800 Subject: [PATCH 3/3] spec: Update release version with !2 increase release verison by one Signed-off-by: Euler Robot --- libvirt.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvirt.spec b/libvirt.spec index 4112a62..0e64f82 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/ -- Gitee