1
0
mirror of https://github.com/google/nomulus synced 2026-01-07 05:56:49 +00:00

Make GPG related tests work with the latest version of GPG (#2568)

Newer versions of GPG (v.2.4.5 in my case) has uses different wording
then what's available in our build image (and Ubuntu I suspect). For
example it says "rsa2048" instead of "2048-bit RSA".

Make the tests work in both cases. Admittedly we cannot check for the
string RSA/rsa easily, but I don't think it matters much for tests.
This commit is contained in:
Lai Jiang
2024-09-26 10:10:07 -04:00
committed by GitHub
parent 08203033a2
commit a22a38527b
3 changed files with 4 additions and 7 deletions

View File

@@ -191,9 +191,7 @@ public class BrdaCopyActionTest {
assertWithMessage("Literal data packet should be in BINARY mode")
.that(stdout)
.contains("mode b ");
assertWithMessage("Unexpected asymmetric encryption algorithm")
.that(stderr)
.contains("encrypted with 2048-bit RSA key");
assertWithMessage("Unexpected asymmetric encryption algorithm").that(stderr).contains("2048");
assertWithMessage("Unexpected receiver public key")
.that(stderr)
.contains("ID 7F9084EE54E1EB0F");

View File

@@ -87,7 +87,8 @@ class GhostrydeGpgIntegrationTest {
assertThat(stdout).contains(":encrypted data packet:");
assertThat(stdout).contains("version 3, algo 1, keyid A59C132F3589A1D5");
assertThat(stdout).contains("name=\"" + Ghostryde.INNER_FILENAME + "\"");
assertThat(stderr).contains("encrypted with 2048-bit RSA key, ID A59C132F3589A1D5");
assertThat(stderr).contains("2048");
assertThat(stderr).contains("ID A59C132F3589A1D5");
pid = gpg.exec(GPG_BINARY, "--use-embedded-filename", file.getPath());
stderr = CharStreams.toString(new InputStreamReader(pid.getErrorStream(), UTF_8));

View File

@@ -148,9 +148,7 @@ public class RydeGpgIntegrationTest {
assertWithMessage("Literal data packet should be in BINARY mode")
.that(stdout)
.contains("mode b ");
assertWithMessage("Unexpected asymmetric encryption algorithm")
.that(stderr)
.contains("encrypted with 2048-bit RSA key");
assertWithMessage("Unexpected asymmetric encryption algorithm").that(stderr).contains("2048");
assertWithMessage("Unexpected receiver public key")
.that(stderr)
.contains("ID 7F9084EE54E1EB0F");