pgpainless-sop: reuse shared sop-java test suite

This commit is contained in:
Paul Schaub 2023-01-31 19:03:11 +01:00
parent f4bd17ade8
commit d53cd6d0bd
Signed by: vanitasvitae
GPG Key ID: 62BEE9264BF17311
11 changed files with 152 additions and 0 deletions

View File

@ -21,10 +21,14 @@ dependencies {
// Logging
testImplementation "ch.qos.logback:logback-classic:$logbackVersion"
// Depend on "shared" sop-java test suite (fixtures are turned into tests by inheritance inside test sources)
testImplementation(testFixtures("org.pgpainless:sop-java:$sopJavaVersion"))
implementation(project(":pgpainless-core"))
api "org.pgpainless:sop-java:$sopJavaVersion"
}
test {
useJUnitPlatform()
environment("test.implementation", "sop.testsuite.pgpainless.PGPainlessSopInstanceFactory")
}

View File

@ -0,0 +1,20 @@
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
//
// SPDX-License-Identifier: Apache-2.0
package sop.testsuite.pgpainless;
import java.util.Collections;
import java.util.Map;
import org.pgpainless.sop.SOPImpl;
import sop.SOP;
import sop.testsuite.SOPInstanceFactory;
public class PGPainlessSopInstanceFactory extends SOPInstanceFactory {
@Override
public Map<String, SOP> provideSOPInstances() {
return Collections.singletonMap("PGPainless-SOP", new SOPImpl());
}
}

View File

@ -0,0 +1,11 @@
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
//
// SPDX-License-Identifier: Apache-2.0
package sop.testsuite.pgpainless.operation;
import sop.testsuite.operation.ArmorDearmorTest;
public class PGPainlessArmorDearmorTest extends ArmorDearmorTest {
}

View File

@ -0,0 +1,11 @@
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
//
// SPDX-License-Identifier: Apache-2.0
package sop.testsuite.pgpainless.operation;
import sop.testsuite.operation.DecryptWithSessionKeyTest;
public class PGPainlessDecryptWIthSessionKeyTest extends DecryptWithSessionKeyTest {
}

View File

@ -0,0 +1,18 @@
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
//
// SPDX-License-Identifier: Apache-2.0
package sop.testsuite.pgpainless.operation;
import org.junit.jupiter.api.Disabled;
import sop.SOP;
import sop.testsuite.operation.DetachedSignDetachedVerifyTest;
public class PGPainlessDetachedSignDetachedVerifyTest extends DetachedSignDetachedVerifyTest {
@Override
@Disabled("Since we allow for dynamic cert loading, we can ignore this test")
public void verifyMissingCertCausesMissingArg(SOP sop) {
super.verifyMissingCertCausesMissingArg(sop);
}
}

View File

@ -0,0 +1,11 @@
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
//
// SPDX-License-Identifier: Apache-2.0
package sop.testsuite.pgpainless.operation;
import sop.testsuite.operation.EncryptDecryptTest;
public class PGPainlessEncryptDecryptTest extends EncryptDecryptTest {
}

View File

@ -0,0 +1,32 @@
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
//
// SPDX-License-Identifier: Apache-2.0
package sop.testsuite.pgpainless.operation;
import java.io.IOException;
import org.junit.jupiter.api.Disabled;
import sop.SOP;
import sop.testsuite.operation.ExtractCertTest;
public class PGPainlessExtractCertTest extends ExtractCertTest {
@Disabled("BC uses old CTBs causing mismatching byte arrays :/")
@Override
public void extractAliceCertFromAliceKeyTest(SOP sop) throws IOException {
super.extractAliceCertFromAliceKeyTest(sop);
}
@Disabled("BC uses old CTBs causing mismatching byte arrays :/")
@Override
public void extractBobsCertFromBobsKeyTest(SOP sop) throws IOException {
super.extractBobsCertFromBobsKeyTest(sop);
}
@Disabled("BC uses old CTBs causing mismatching byte arrays :/")
@Override
public void extractCarolsCertFromCarolsKeyTest(SOP sop) throws IOException {
super.extractCarolsCertFromCarolsKeyTest(sop);
}
}

View File

@ -0,0 +1,11 @@
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
//
// SPDX-License-Identifier: Apache-2.0
package sop.testsuite.pgpainless.operation;
import sop.testsuite.operation.GenerateKeyTest;
public class PGPainlessGenerateKeyTest extends GenerateKeyTest {
}

View File

@ -0,0 +1,12 @@
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
//
// SPDX-License-Identifier: Apache-2.0
package sop.testsuite.pgpainless.operation;
import sop.testsuite.operation.InlineSignInlineDetachDetachedVerifyTest;
public class PGPainlessInlineSignInlineDetachDetachedVerifyTest
extends InlineSignInlineDetachDetachedVerifyTest {
}

View File

@ -0,0 +1,11 @@
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
//
// SPDX-License-Identifier: Apache-2.0
package sop.testsuite.pgpainless.operation;
import sop.testsuite.operation.InlineSignInlineVerifyTest;
public class PGPainlessInlineSignInlineVerifyTest extends InlineSignInlineVerifyTest {
}

View File

@ -0,0 +1,11 @@
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
//
// SPDX-License-Identifier: Apache-2.0
package sop.testsuite.pgpainless.operation;
import sop.testsuite.operation.VersionTest;
public class PGPainlessVersionTest extends VersionTest {
}