From nobody Mon Dec 15 23:51:46 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 1513884833153653.9086111242759; Thu, 21 Dec 2017 11:33:53 -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 4691E7F7A9; Thu, 21 Dec 2017 19:33:51 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7ECAC2C309; Thu, 21 Dec 2017 19:33:50 +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 EEFB84A467; Thu, 21 Dec 2017 19:33:49 +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 vBLJXmoB025350 for ; Thu, 21 Dec 2017 14:33:48 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4E2881710F; Thu, 21 Dec 2017 19:33:48 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 45E381800C for ; Thu, 21 Dec 2017 19:33:48 +0000 (UTC) Received: from mail-qk0-f194.google.com (mail-qk0-f194.google.com [209.85.220.194]) (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 ECC3C3683C for ; Thu, 21 Dec 2017 19:33:46 +0000 (UTC) Received: by mail-qk0-f194.google.com with SMTP id i190so11868608qka.5 for ; Thu, 21 Dec 2017 11:33:46 -0800 (PST) Received: from localhost.localdomain ([189.0.171.32]) by smtp.googlemail.com with ESMTPSA id b65sm4440515qkc.0.2017.12.21.11.33.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Dec 2017 11:33:45 -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=rTHj4GQmuheauMKRKZduuCaV/od/1UX1sC6DBbFqHxA=; b=hGX7yLV1kVDMURP6B+m5gB4w1oybY7ldnRuqf+3uHV+9tSEE0I2aRY/sY9AKywebWR KDZsoOfrD3p55LpSBs0aDl5lyA9gZ949rpIwt4RLWiMUXCLK635A2a1BsANgYvG+uySl 4jqVFOd6AqM2O6IOlae3+c+sl71WHju69zswrCPaAo5hzwkXv4furJmqMG1KicQkw/LS 53pwpXNPRNinaKR/jZo+LYkj/Pn60t37595naY4pq5bcec94BE5Mr6g9TK3ZVQkB3qC2 796C1wJQr53+PbU0NyIAkIWpnBTuIPYokycRQmga57Xn++smAYF4fPkQPz7NaHW3nxKm nBlw== 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=rTHj4GQmuheauMKRKZduuCaV/od/1UX1sC6DBbFqHxA=; b=bQC8iqvlZdlool3PIecJvgPRC2Z9Gd3OZmOIikXky+EqQcgB32F2vRDCZWS+zNtU5n LkGhND62j1aft9bcYHOhdBQbD/V/J/I+uRttgyS4X9qz3irXHiJ8d0WQlbskb5BSb4PB RYKMC3RpyC3XESZTB7jTcIFON+KFF4omh7EsNXSX99Ax6cOmyGbmnMQRDTPTHHcv3szS 6j1jsn+OA0hL+nTZ/EYhNTF+oJBLfQKoQXfEDFGQcZCfiIpgub1knaYxUNzXWYRBR8ft E5e6KZ3zwHOh2aAEIAW84u8nmo42k77NBKHtZFSVHL1VzoQbRknPuY+EEkthVl/V4Sxm Izeg== X-Gm-Message-State: AKGB3mKgRCsZNJQmG7gM3vHU45U8rdqgmK/fDUucpAXkC7R2FMwcdTZ8 1HX3Ug/6mmc3tMkY8G+WIr+USg== X-Google-Smtp-Source: ACJfBou8sr97T8DEN/w54bfxu/hUC7rEOq9H6pHmXeSBLxp67ab0lTcjey1ZDPaoum7m5/jSQmPqGg== X-Received: by 10.55.159.145 with SMTP id i139mr16013807qke.339.1513884825943; Thu, 21 Dec 2017 11:33:45 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Date: Thu, 21 Dec 2017 17:33:28 -0200 Message-Id: <1513884808-22472-3-git-send-email-jcfaracco@gmail.com> In-Reply-To: <1513884808-22472-1-git-send-email-jcfaracco@gmail.com> References: <1513884808-22472-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.30]); Thu, 21 Dec 2017 19:33:47 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 21 Dec 2017 19:33:47 +0000 (UTC) for IP:'209.85.220.194' DOMAIN:'mail-qk0-f194.google.com' HELO:'mail-qk0-f194.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.220.194 mail-qk0-f194.google.com 209.85.220.194 mail-qk0-f194.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 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.28]); Thu, 21 Dec 2017 19:33:51 +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