From nobody Mon Feb 9 04:15:14 2026 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1544028497253825.0682961724794; Wed, 5 Dec 2018 08:48:17 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 45EAF89ACF; Wed, 5 Dec 2018 16:48:14 +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 10BC05DA60; Wed, 5 Dec 2018 16:48:14 +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 BF0B83F608; Wed, 5 Dec 2018 16:48:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wB5Gm4ge028457 for ; Wed, 5 Dec 2018 11:48:04 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1D0CD4F9AB; Wed, 5 Dec 2018 16:48:04 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6E7FB4F9D7; Wed, 5 Dec 2018 16:48:03 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 5 Dec 2018 17:47:48 +0100 Message-Id: <3c38120022a5d476bf48e51837817d6918838409.1544028281.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 07/10] DO NOT PUSH: Make sure that error messages are not moved around 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: , 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 05 Dec 2018 16:48:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Add a virerrortest case that makes sure that all error messages stay the same while refactoring. This patch will not be pushed upstream to avoid polluting the git history. --- tests/virerrormessages.txt | 101 +++++++++++++++++++++++++++++++++++++ tests/virerrortest.c | 25 +++++++++ 2 files changed, 126 insertions(+) create mode 100644 tests/virerrormessages.txt diff --git a/tests/virerrormessages.txt b/tests/virerrormessages.txt new file mode 100644 index 0000000000..7db66fa09b --- /dev/null +++ b/tests/virerrormessages.txt @@ -0,0 +1,101 @@ +1-internal error-internal error: %s +2-out of memory-out of memory: %s +3-this function is not supported by the connection driver-this function is= not supported by the connection driver: %s +4-unknown host-unknown host %s +5-no connection driver available-no connection driver available for %s +6-invalid connection pointer in-invalid connection pointer in %s +7-invalid domain pointer in-invalid domain pointer in %s +8-invalid argument-invalid argument: %s +9-operation failed-operation failed: %s +10-GET operation failed-GET operation failed: %s +11-POST operation failed-POST operation failed: %s +12-got unknown HTTP error code-got unknown HTTP error code %s +13-failed to serialize S-Expr-failed to serialize S-Expr: %s +14-could not use Xen hypervisor entry-could not use Xen hypervisor entry %s +15-failed Xen syscall-failed Xen syscall %s +16-unknown OS type-unknown OS type %s +17-missing kernel information-missing kernel information: %s +18-missing root device information-missing root device information in %s +19-missing source information for device-missing source information for de= vice %s +20-missing target information for device-missing target information for de= vice %s +21-missing name information-missing name information in %s +22-missing operating system information-missing operating system informati= on for %s +23-missing devices information-missing devices information for %s +24-could not connect to Xen Store-could not connect to Xen Store %s +25-too many drivers registered-too many drivers registered in %s +26-library call failed, possibly not supported-library call %s failed, pos= sibly not supported +27-XML description is invalid or not well formed-XML error: %s +28-this domain exists already-domain %s exists already +29-operation forbidden for read only access-operation forbidden: %s +30-failed to open configuration file for reading-failed to open %s for rea= ding +31-failed to read configuration file-failed to read configuration file %s +32-failed to parse configuration file-failed to parse configuration file %s +33-configuration file syntax error-configuration file syntax error: %s +34-failed to write configuration file-failed to write configuration file: = %s +35-parser error-%s +36-invalid network pointer in-invalid network pointer in %s +37-this network exists already-network %s exists already +38-system call error-%s +39-RPC error-%s +40-GNUTLS call error-%s +41-Failed to find the network-Failed to find the network: %s +42-Domain not found-Domain not found: %s +43-Network not found-Network not found: %s +44-invalid MAC address-invalid MAC address: %s +45-authentication failed-authentication failed: %s +46-invalid storage pool pointer in-invalid storage pool pointer in %s +47-invalid storage volume pointer in-invalid storage volume pointer in %s +48-Failed to find a storage driver-Failed to find a storage driver: %s +49-Storage pool not found-Storage pool not found: %s +50-Storage volume not found-Storage volume not found: %s +51-Failed to find a node driver-Failed to find a node driver: %s +52-invalid node device pointer-invalid node device pointer in %s +53-Node device not found-Node device not found: %s +54-Security model not found-Security model not found: %s +55-Requested operation is not valid-Requested operation is not valid: %s +56-Failed to find the interface-Failed to find the interface: %s +57-Interface not found-Interface not found: %s +58-invalid interface pointer in-invalid interface pointer in %s +59-multiple matching interfaces found-multiple matching interfaces found: = %s +60-Failed to start the nwfilter driver-Failed to start the nwfilter driver= : %s +61-Invalid network filter-Invalid network filter: %s +62-Network filter not found-Network filter not found: %s +63-Error while building firewall-Error while building firewall: %s +64-Failed to find a secret storage driver-Failed to find a secret storage = driver: %s +65-Invalid secret-Invalid secret: %s +66-Secret not found-Secret not found: %s +67-unsupported configuration-unsupported configuration: %s +68-Timed out during operation-Timed out during operation: %s +69-Failed to make domain persistent after migration-Failed to make domain = persistent after migration: %s +70-Hook script execution failed-Hook script execution failed: %s +71-Invalid snapshot-Invalid snapshot: %s +72-Domain snapshot not found-Domain snapshot not found: %s +73-invalid stream pointer-invalid stream pointer in %s +74-argument unsupported-argument unsupported: %s +75-Storage pool probe failed-Storage pool probe failed: %s +76-Storage pool already built-Storage pool already built: %s +77-revert requires force-revert requires force: %s +78-operation aborted-operation aborted: %s +79-authentication cancelled-authentication cancelled: %s +80-metadata not found-metadata not found: %s +81-Unsafe migration-Unsafe migration: %s +82-numerical overflow-numerical overflow: %s +83-block copy still active-block copy still active: %s +84-Operation not supported-Operation not supported: %s +85-SSH transport error-SSH transport error: %s +86-Guest agent is not responding-Guest agent is not responding: %s +87-resource busy-resource busy: %s +88-access denied-access denied: %s +89-error from service-error from service: %s +90-this storage volume exists already-storage volume %s exists already +91-the CPU is incompatible with host CPU-the CPU is incompatible with host= CPU: %s +92-XML document failed to validate against schema-XML document failed to v= alidate against schema: %s +93-migration successfully aborted-migration successfully aborted: %s +94-authentication unavailable-authentication unavailable: %s +95-Server not found-Server not found: %s +96-Client not found-Client not found: %s +97-guest agent replied with wrong id to guest-sync command-guest agent rep= lied with wrong id to guest-sync command: %s +98-libssh transport error-libssh transport error: %s +99-device not found-device not found: %s +100-Invalid network filter binding-Invalid network filter binding: %s +101-Network filter binding not found-Network filter binding not found: %s diff --git a/tests/virerrortest.c b/tests/virerrortest.c index 0d0377bfa8..e985ca743b 100644 --- a/tests/virerrortest.c +++ b/tests/virerrortest.c @@ -87,6 +87,29 @@ virErrorTestMsgs(const void *opaque ATTRIBUTE_UNUSED) } +static int +virErrorTestMsgsStable(const void *opaque ATTRIBUTE_UNUSED) +{ + virBuffer buf =3D VIR_BUFFER_INITIALIZER; + char *actual =3D NULL; + size_t i; + int ret =3D 0; + + for (i =3D 1; i < VIR_ERR_NUMBER_LAST; i++) { + virBufferAsprintf(&buf, "%zu-", i); + virBufferStrcat(&buf, virErrorMsg(i, NULL), "-", virErrorMsg(i, ""= ), "\n", NULL); + } + + actual =3D virBufferContentAndReset(&buf); + + if (virTestCompareToFile(actual, abs_srcdir "/virerrormessages.txt") <= 0) + ret =3D -1; + + VIR_FREE(actual); + return ret; +} + + static int mymain(void) { @@ -94,6 +117,8 @@ mymain(void) if (virTestRun("error message strings ", virErrorTestMsgs, NULL) < 0) ret =3D -1; + if (virTestRun("error message strings stability ", virErrorTestMsgsSta= ble, NULL) < 0) + ret =3D -1; return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list