From patchwork Tue Apr 12 22:33:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 65660 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp2177169qge; Tue, 12 Apr 2016 15:36:36 -0700 (PDT) X-Received: by 10.140.227.82 with SMTP id x79mr7496292qhb.101.1460500596242; Tue, 12 Apr 2016 15:36:36 -0700 (PDT) Return-Path: Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com. [209.132.183.39]) by mx.google.com with ESMTPS id v186si26188428qhc.17.2016.04.12.15.36.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Apr 2016 15:36:36 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.39 as permitted sender) client-ip=209.132.183.39; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.39 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3CMY2hQ033682; Tue, 12 Apr 2016 18:34:03 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u3CMY1A7007225 for ; Tue, 12 Apr 2016 18:34:01 -0400 Received: from colepc.redhat.com (ovpn-113-40.phx2.redhat.com [10.3.113.40]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3CMY0cS007948; Tue, 12 Apr 2016 18:34:00 -0400 From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 12 Apr 2016 18:33:57 -0400 Message-Id: <78053b9f554b2b172933f5e1fbf77a4073df0112.1460500437.git.crobinso@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] tests: Fix VIR_TEST_REGENERATE_OUTPUT X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com commit 950a90d489 mocked some virCommand handling for the qemu tests, but we were using that in the test suite to call test-wrap-argv.pl for regenerating test output. Switch the generator code to just use system() instead --- tests/testutils.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) -- 2.7.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/tests/testutils.c b/tests/testutils.c index a0ce4b6..4f3e67b 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -434,24 +434,15 @@ virTestRewrapFile(const char *filename) { int ret = -1; char *outbuf = NULL; - char *script = NULL; - virCommandPtr cmd = NULL; + char *cmd = NULL; - if (virAsprintf(&script, "%s/test-wrap-argv.pl", abs_srcdir) < 0) + if (virAsprintf(&cmd, "echo \"$(%s/test-wrap-argv.pl %s)\" > %s", + abs_srcdir, filename, filename) < 0) goto cleanup; - cmd = virCommandNewArgList(script, filename, NULL); - virCommandSetOutputBuffer(cmd, &outbuf); - if (virCommandRun(cmd, NULL) < 0) - goto cleanup; - - if (virFileWriteStr(filename, outbuf, 0666) < 0) - goto cleanup; - - ret = 0; + ret = system(cmd); cleanup: - VIR_FREE(script); - virCommandFree(cmd); + VIR_FREE(cmd); VIR_FREE(outbuf); return ret; }