From nobody Thu May 15 02:13:09 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1516043953621921.3182670271491; Mon, 15 Jan 2018 11:19:13 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AF36D7E420; Mon, 15 Jan 2018 19:19:11 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D1CA55D6A5; Mon, 15 Jan 2018 19:19:10 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D72B418033DB; Mon, 15 Jan 2018 19:19:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w0FJIdFe017954 for ; Mon, 15 Jan 2018 14:18:39 -0500 Received: by smtp.corp.redhat.com (Postfix) id DCCB45C257; Mon, 15 Jan 2018 19:18:39 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D6C9B5C20A for ; Mon, 15 Jan 2018 19:18:36 +0000 (UTC) Received: from mail-qt0-f193.google.com (mail-qt0-f193.google.com [209.85.216.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 01B2C7AE8B for ; Mon, 15 Jan 2018 19:18:28 +0000 (UTC) Received: by mail-qt0-f193.google.com with SMTP id i40so15451325qti.8 for ; Mon, 15 Jan 2018 11:18:27 -0800 (PST) Received: from localhost.localdomain ([177.45.186.140]) by smtp.googlemail.com with ESMTPSA id y23sm240675qtj.20.2018.01.15.11.18.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Jan 2018 11:18:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=N4xid9b2U+DHeEXxsbtNDVBBij4JJiE4oh9tkAvRy+0=; b=eUw4cY0Rg4t8aESBTXEgWLeIzC2BuLGOrxyFLYJt5vbXxtsFJfMJLlotZsn7wMK4mn 0oS1L/3B3IKDK3vpqoHvA5B4B/pcXYwOBoBBqgRjxZ4pXLevcJ5CKZrWXPuzvYhrsxoo jHFn/JV4G80WGhl3ntGtd8Ihbtziidv9ZFOzE1/C9eSoYnKdkAQQgOvhDx2RGaiht26z sQWctm50SttWdhUa6rxb39DgnRURWcFNsoVviDy3S2LBiYhban1HsfUjgbRrlej6q50U dZpYHnqhG53z3bCri+28cZg+1+yMuSuaul3tXmeXJvL9zMBicvDZX3sLlKHi9fQeho8Q yNfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=N4xid9b2U+DHeEXxsbtNDVBBij4JJiE4oh9tkAvRy+0=; b=lXeSFyioAaSf8u7xKMTE1NxJtjHEE1QcbuzQ3UMeoJx8yTCuyzPamuhPwT5wfhlICS jaMyToi8kNbE6NeDTqoxO6yzWbFr+GDI1UVI+s5yoU7u9piJZtEVlwsddqLkIg/o/pJL CYnvHe7/3KY+K88Uj5d9+G3lDyudt272Ff/QISeGJNlpvZR08cDnkVz74dJiZtQ5xhZk zDkrZLBdSdc+Q3W2tOfj8X4sdHUVXKWYrDrUIiXWI4AB3oIWNRlrJ42ad9P0P/iZCfSj YUBtxTlozqpeImE4mMCvgYlVeryfeJLnr8KN0ujz78oZNjFQITIahvS+tdBlBVsLKpo+ sfWQ== X-Gm-Message-State: AKwxytf0gkljKS4ps2F6BCCJ+9tolBV2m5FqaJdmT2D3BXoYoGAr8UJ2 zk8QbLHJ/dMypdsKVDQoCqkqbA== X-Google-Smtp-Source: ACJfBosK9LKBDmQMzLN9Mrcbc31iGYi+HE8la9sYNBkrr+c8ogbn0lYf9s6JcwnYyp8/ZkvP+go4Nw== X-Received: by 10.237.55.166 with SMTP id j35mr50811382qtb.31.1516043906901; Mon, 15 Jan 2018 11:18:26 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Date: Mon, 15 Jan 2018 17:18:09 -0200 Message-Id: <1516043889-32720-3-git-send-email-jcfaracco@gmail.com> In-Reply-To: <1516043889-32720-1-git-send-email-jcfaracco@gmail.com> References: <1516043889-32720-1-git-send-email-jcfaracco@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 15 Jan 2018 19:18:28 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 15 Jan 2018 19:18:28 +0000 (UTC) for IP:'209.85.216.193' DOMAIN:'mail-qt0-f193.google.com' HELO:'mail-qt0-f193.google.com' FROM:'jcfaracco@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.13 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 209.85.216.193 mail-qt0-f193.google.com 209.85.216.193 mail-qt0-f193.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 2/2] tests: Adding test case for virsh 'domrename' command. 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 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 15 Jan 2018 19:19:12 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This commit introduce the virsh-rename test script to test the 'domrename' command. The test contains one succedeed script to rename and another failed test. Signed-off-by: Julio Faracco --- tests/Makefile.am | 1 + tests/virsh-rename | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100755 tests/virsh-rename diff --git a/tests/Makefile.am b/tests/Makefile.am index 3441dab..0ff90fb 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -410,6 +410,7 @@ libvirtd_test_scripts =3D \ virt-admin-self-test \ virsh-start \ virsh-undefine \ + virsh-rename \ virsh-uriprecedence \ virsh-vcpupin \ $(NULL) diff --git a/tests/virsh-rename b/tests/virsh-rename new file mode 100755 index 0000000..4d976bb --- /dev/null +++ b/tests/virsh-rename @@ -0,0 +1,43 @@ +#!/bin/sh +# exercise virsh's "domrename" command + +# Copyright (C) 2008-2009, 2017 Red Hat, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHEXP ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see +# . + +. "$(dirname $0)/test-lib.sh" + +if test "$VERBOSE" =3D yes; then + set -x + $abs_top_builddir/tools/virsh --version +fi + +fail=3D0 + +# Succeed, now: first shut down, then rename the domain. +$abs_top_builddir/tools/virsh -q -c test:///default \ + 'shutdown test; domrename test anothertest' > out 2>&1 +test $? =3D 1 && fail=3D1 + +# Failed, now: rename the domain without shutting down. +$abs_top_builddir/tools/virsh -q -c test:///default \ + 'domrename test anothertest' > out 2>&1 +test $? =3D 1 || fail=3D1 +cat <<\EOF > expout || fail=3D1 +error: Requested operation is not valid: cannot rename active domain +EOF +compare expout out || fail=3D1 + +(exit $fail); exit $fail --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list