summaryrefslogtreecommitdiff
path: root/tests/commandtest.c
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2019-06-25 18:09:31 +0100
committerDaniel P. Berrangé <berrange@redhat.com>2019-07-12 16:55:40 +0100
commit2dfacbffea47743fff942b6401f5f36b3ae4655a (patch)
treec39af46ca41e85700c3e6bf3abba26f515e16cf4 /tests/commandtest.c
parentee04bfaf9d03a3775628f0139070f3addd84d581 (diff)
downloadlibvirt-2dfacbffea47743fff942b6401f5f36b3ae4655a.tar.gz
util: remove code spawning with systemd activation env vars
The only use of this code was removed by: commit be78814ae07f092d9c4e71fd82dd1947aba2f029 Author: Michal Privoznik <mprivozn@redhat.com> Date: Thu Apr 2 14:41:17 2015 +0200 virNetSocketNewConnectUNIX: Use flocks when spawning a daemon less than a year after it was first introduced in commit 1b807f92dbb617db5b9d551777d3026d8ff0903f Author: Martin Kletzander <mkletzan@redhat.com> Date: Wed Jul 16 08:00:19 2014 +0200 rpc: pass listen FD to the daemon being started Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'tests/commandtest.c')
-rw-r--r--tests/commandtest.c58
1 files changed, 0 insertions, 58 deletions
diff --git a/tests/commandtest.c b/tests/commandtest.c
index 146cc4c1bf..ce0832fb0c 100644
--- a/tests/commandtest.c
+++ b/tests/commandtest.c
@@ -1003,63 +1003,6 @@ test23(const void *unused ATTRIBUTE_UNUSED)
return ret;
}
-static int test24(const void *unused ATTRIBUTE_UNUSED)
-{
- char *pidfile = virPidFileBuildPath(abs_builddir, "commandhelper");
- char *prefix = NULL;
- int newfd1 = dup(STDERR_FILENO);
- int newfd2 = dup(STDERR_FILENO);
- int newfd3 = dup(STDERR_FILENO);
- int ret = -1;
- pid_t pid;
- virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
-
- if (!pidfile)
- goto cleanup;
-
- if (VIR_CLOSE(newfd1) < 0)
- printf("Cannot close fd %d\n", newfd1);
-
- virCommandSetPidFile(cmd, pidfile);
- virCommandDaemonize(cmd);
- virCommandPassFD(cmd, newfd2, VIR_COMMAND_PASS_FD_CLOSE_PARENT);
- virCommandPassFD(cmd, newfd3, VIR_COMMAND_PASS_FD_CLOSE_PARENT);
- newfd2 = newfd3 = -1;
- virCommandPassListenFDs(cmd);
-
- if (virCommandRun(cmd, NULL) < 0) {
- printf("Cannot run child %s\n", virGetLastErrorMessage());
- goto cleanup;
- }
-
- if (virPidFileRead(abs_builddir, "commandhelper", &pid) < 0) {
- printf("cannot read pidfile\n");
- goto cleanup;
- }
-
- if (virAsprintf(&prefix,
- "ENV:LISTEN_FDS=2\nENV:LISTEN_PID=%u\n",
- pid) < 0)
- goto cleanup;
-
- while (kill(pid, 0) != -1)
- usleep(100*1000);
-
- ret = checkoutput("test24", prefix);
-
- cleanup:
- if (pidfile)
- unlink(pidfile);
- VIR_FREE(pidfile);
- VIR_FREE(prefix);
- virCommandFree(cmd);
- VIR_FORCE_CLOSE(newfd1);
- VIR_FORCE_CLOSE(newfd2);
- VIR_FORCE_CLOSE(newfd3);
- return ret;
-}
-
-
static int test25(const void *unused ATTRIBUTE_UNUSED)
{
int ret = -1;
@@ -1347,7 +1290,6 @@ mymain(void)
DO_TEST(test21);
DO_TEST(test22);
DO_TEST(test23);
- DO_TEST(test24);
DO_TEST(test25);
DO_TEST(test26);