Browse Source

Tests: NOW, since KER all test cases using import_key() are broken.

set_comm_partner_key() has to be added.
JNI-157
heck 1 month ago
parent
commit
6ecc388b16
7 changed files with 19 additions and 4 deletions
  1. +2
    -2
      test/java/foundation/pEp/jniadapter/test/Makefile
  2. +4
    -0
      test/java/foundation/pEp/jniadapter/test/basic/TestMain.java
  3. +1
    -0
      test/java/foundation/pEp/jniadapter/test/jni115/TestAlice.java
  4. +1
    -0
      test/java/foundation/pEp/jniadapter/test/jni118/TestAlice.java
  5. +2
    -0
      test/java/foundation/pEp/jniadapter/test/jni98/TestMain.java
  6. +6
    -0
      test/java/foundation/pEp/jniadapter/test/regression/TestMain.java
  7. +3
    -2
      test/java/foundation/pEp/pitytest/TestLogger.java

+ 2
- 2
test/java/foundation/pEp/jniadapter/test/Makefile View File

@ -4,7 +4,7 @@ all: compile
run: compile
$(MAKE) -C basic
$(MAKE) -C regression
# Disabled because broken since KER $(MAKE) -C regression
#$(MAKE) -C jni88
#$(MAKE) -C jni91
#$(MAKE) -C jni92
@ -17,7 +17,7 @@ run: compile
$(MAKE) -C jni115
$(MAKE) -C jni118
$(MAKE) -C jni125
$(MAKE) -C jni126
# Disabled because broken since KER $(MAKE) -C jni126
$(MAKE) -C jni132
$(MAKE) -C jni134
#$(MAKE) -C jni135


+ 4
- 0
test/java/foundation/pEp/jniadapter/test/basic/TestMain.java View File

@ -40,6 +40,10 @@ class TestMain {
ctx.engine.importKey(ctx.keyBobPub);
});
new TestUnit<BasicTestContext>("set comm partner key", btc, ctx -> {
ctx.engine.set_comm_partner_key(ctx.bob, "F804FBE1781F3E2F6158F9F709FB5BDA72BE51C1");
});
new TestUnit<BasicTestContext>("Trustwords", btc, ctx -> {
ctx.carol = new Identity();
ctx.carol.fpr = "4ABE3AAF59AC32CFE4F86500A9411D176FF00E97";


+ 1
- 0
test/java/foundation/pEp/jniadapter/test/jni115/TestAlice.java View File

@ -106,6 +106,7 @@ class TestAlice {
// Key import
new TestUnit<Jni115TestContext>("importKey()", ctx1, ctx -> {
ctx.engine.importKey(ctx.keyBobPub);
ctx.engine.set_comm_partner_key(ctx.bob, "F804FBE1781F3E2F6158F9F709FB5BDA72BE51C1");
}).run();
// Perf test for ENCRTYPTED (with pubkey)


+ 1
- 0
test/java/foundation/pEp/jniadapter/test/jni118/TestAlice.java View File

@ -47,6 +47,7 @@ class JNI1118Context extends CTXBase {
super.init();
alice = engine.myself(alice);
engine.importKey(keyBobPub);
engine.set_comm_partner_key(bob, "F804FBE1781F3E2F6158F9F709FB5BDA72BE51C1");
Vector<Identity> msgToBobRcpts = new Vector<>();
msgToBobRcpts.add(bob);


+ 2
- 0
test/java/foundation/pEp/jniadapter/test/jni98/TestMain.java View File

@ -30,6 +30,7 @@ class TestMain {
public static void main(String[] args) throws Exception {
new TestUnit<CTXBase>("JNI-98 - Message.EncFormat.PEP", new CTXBase(), ctx -> {
ctx.engine.importKey(ctx.keyBobPub);
ctx.engine.set_comm_partner_key(ctx.bob, "F804FBE1781F3E2F6158F9F709FB5BDA72BE51C1");
// Make msg1 by encrypting msgToBob
logH2("Create target Message");
Message msg1 = ctx.engine.encrypt_message(ctx.msgAliceToBob, null, Message.EncFormat.PEP);
@ -53,6 +54,7 @@ class TestMain {
new TestUnit<CTXBase>("JNI-98 - Message.EncFormat.PEP_enc_inline_EA", new CTXBase(), ctx -> {
ctx.engine.importKey(ctx.keyBobPub);
ctx.engine.set_comm_partner_key(ctx.bob, "F804FBE1781F3E2F6158F9F709FB5BDA72BE51C1");
// Make msg1 by encrypting msgToBob
logH2("Create target Message");
Message msg1 = ctx.engine.encrypt_message(ctx.msgAliceToBob, null, Message.EncFormat.PEPEncInlineEA);


+ 6
- 0
test/java/foundation/pEp/jniadapter/test/regression/TestMain.java View File

@ -22,6 +22,7 @@ class CTXAlice2 extends CTXAlice {
public CTXAlice2 init() throws Throwable {
super.init();
engine.importKey(keyBobSec);
engine.set_comm_partner_key(bob, "F804FBE1781F3E2F6158F9F709FB5BDA72BE51C1");
bob = engine.updateIdentity(bob);
return this;
}
@ -38,6 +39,7 @@ class CTXReEvaluateMessageRating extends CTXBase {
super.init();
alice = engine.myself(alice);
engine.importKey(keyBobPub);
engine.set_comm_partner_key(bob, "F804FBE1781F3E2F6158F9F709FB5BDA72BE51C1");
Vector<Identity> msgToBobRcpts = new Vector<>();
msgToBobRcpts.add(bob);
@ -227,6 +229,10 @@ class TestMain {
ctx.engine.importKey(ctx.keyBobPub);
});
new TestUnit<CTXBase>("Engine.set_comm_partner_key", new CTXBase(), ctx -> {
ctx.engine.set_comm_partner_key(ctx.bob, "F804FBE1781F3E2F6158F9F709FB5BDA72BE51C1");
});
new TestUnit<CTXBase>("Engine.config_passive_mode", new CTXBase(), ctx -> {
ctx.engine.config_passive_mode(false);
});


+ 3
- 2
test/java/foundation/pEp/pitytest/TestLogger.java View File

@ -25,10 +25,11 @@ public class TestLogger {
if (!initialized) {
logEnabled = true;
threadStrLen = 10;
lineWidth = 80;
lineWidth = 120;
threadSeparator = ": ";
tryDetermineTermSize();
// TODO: Disabled term size detection, not working anymore on macOS at least.... grmpl
// tryDetermineTermSize();
initialized = true;
}
}


Loading…
Cancel
Save