Browse Source

ENGINE-633: some non-pEp mail tests added

IPS-2
Krista Bennett 11 months ago
parent
commit
7fa5958e15
3 changed files with 170 additions and 5 deletions
  1. +14
    -5
      test/src/DefaultFromEmailTest.cc
  2. +67
    -0
      test/test_mails/CanonicalFrom2.2BobToAliceUnencrypted_OpenPGP.eml
  3. +89
    -0
      test/test_mails/CanonicalFrom2.2SylviaToAliceUnencrypted_OpenPGP.eml

+ 14
- 5
test/src/DefaultFromEmailTest.cc View File

@ -842,10 +842,20 @@ TEST_F(DefaultFromEmailTest, check_pEp_v2_2_import_two_alternate_available) {
// A. Test successful cases
TEST_F(DefaultFromEmailTest, check_unencrypted_key_import_carol) {
TEST_F(DefaultFromEmailTest, check_unencrypted_key_import_bob_no_pEp) {
const TestUtilsPreset::IdentityInfo& sender_info = TestUtilsPreset::presets[TestUtilsPreset::BOB];
set_up_and_check_initial_identities(TestUtilsPreset::BOB, sender_info);
// Ok, we now have a blank slate. Run the import mail fun.
read_decrypt_check_incoming_mail("test_mails/CanonicalFrom2.2BobToAliceUnencrypted_OpenPGP.eml",
PEP_rating_unencrypted, PEP_UNENCRYPTED);
// Check that the default key matches the canonical default key for this sender,
// if expected to be present.
check_sender_default_key_status(sender_info, PEP_ct_OpenPGP_unconfirmed);
}
TEST_F(DefaultFromEmailTest, check_unencrypted_key_import_john) {
TEST_F(DefaultFromEmailTest, check_unencrypted_key_import_sylvia_no_pEp) {
}
TEST_F(DefaultFromEmailTest, check_unencrypted_key_import_sylvia) {
@ -853,13 +863,12 @@ TEST_F(DefaultFromEmailTest, check_unencrypted_key_import_sylvia) {
set_up_and_check_initial_identities(TestUtilsPreset::SYLVIA, sender_info);
// Ok, we now have a blank slate. Run the import mail fun.
read_decrypt_check_incoming_mail("test_mails/CanonicalFrom2.2SylviaToAliceUnencrypted.eml",
read_decrypt_check_incoming_mail("test_mails/CanonicalFrom2.2SylviaToAliceUnencrypted_OpenPGP.eml",
PEP_rating_unencrypted, PEP_UNENCRYPTED);
// Check that the default key matches the canonical default key for this sender,
// if expected to be present.
check_sender_default_key_status(sender_info, PEP_ct_pEp_unconfirmed);
check_sender_default_key_status(sender_info, PEP_ct_OpenPGP_unconfirmed);
}
TEST_F(DefaultFromEmailTest, check_unencrypted_key_import_bob) {


+ 67
- 0
test/test_mails/CanonicalFrom2.2BobToAliceUnencrypted_OpenPGP.eml View File

@ -0,0 +1,67 @@
X-Envelope-From: <pep.test.bob@pep-project.org>
X-Delivery-Time: 1624019274
X-UID: 25795
Return-Path: <pep.test.bob@pep-project.org>
From: pep.test.bob@pep-project.org
Subject: unencrypted mail with key
To: pep.test.alice@pep-project.org
Message-ID: <a000ead8-8ded-eead-4094-a557845ec069@darthmama.org>
Date: Fri, 18 Jun 2021 14:27:53 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.8.1
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="------------CFDC8333F6E9B7FAB7FB0D85"
Content-Language: en-US
This is a multi-part message in MIME format.
--------------CFDC8333F6E9B7FAB7FB0D85
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Here's an unencrypted OpenPGP mail with my key, fools!
--------------CFDC8333F6E9B7FAB7FB0D85
Content-Type: text/plain; charset=UTF-8;
name="pep-test-bob-0xC9C2EE39_pub.asc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="pep-test-bob-0xC9C2EE39_pub.asc"
LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tCgptUUVOQkZWNFBsOEJDQUN1
dWtRTHdzSGZ0SDVqa1ZzU0w3Q09GaGFtTnNFRThsWjhNRzFmMVJ4NXp0UHVaVG5hCllYeVdP
RGdwajJCeHowVGNQK1ExN0diTEtzZTdUV0QxazlpMVJ6TFd6OFpTQ0xZcTJUdGpMV1BsZVZ1
R0dXZXEKWTN0VFdIQy9uRmJpdm9sTlBBMG1MMjAzOFRHZEJvbFBhWmlQWjR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
test/test_mails/CanonicalFrom2.2SylviaToAliceUnencrypted_OpenPGP.eml View File

@ -0,0 +1,89 @@
From: sylvia@darthmama.org
Subject: unencrypted mail with key
To: Alice Spivek Hyatt <pep.test.alice@pep-project.org>
Message-ID: <426741a7-9142-117a-bba1-249b6068b104@darthmama.org>
Date: Fri, 18 Jun 2021 14:22:06 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.8.1
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="------------CE0FAF85E74A139FFF01B697"
Content-Language: en-US
This is a multi-part message in MIME format.
--------------CE0FAF85E74A139FFF01B697
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Here's an unencrypted OpenPGP mail with my key, fools!
--------------CE0FAF85E74A139FFF01B697
Content-Type: text/plain; charset=UTF-8;
name="sylvia-0x585A6780_pub.asc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="sylvia-0x585A6780_pub.asc"
LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tCgptUUlOQkdDNC9PVUJFQUM3
Z2Z3NUk4eldtcHVXWWRLeTNZZGF3bXBSaE5sMTBsTmhBY1o0ZDBack01YjhQcWVzCmZXN21H
MStLOTZ5dHdmS3ZzaWlRWEorTGN2dGowcUlRTm03YlN6NEFTOXQ0ZHIvNFIrMFVxYmw4NGxU
RGlQN2cKVUJobVNMdERhOU16bVA0WXZDclRRS2kxSjhvUlkvaEpWN2UrZkNBQVpVTDAvdks1
NFEyaWMxdTlndUk5Njd4dQpxQTZEOWFSNHkrOVZRRFdmN1dEZkhiZ2NaTk9ldkZSTHlVZHNO
VmdvVFNKbWZDOUYzOE42b05ub3pBVUFNRm53CmVFRk5yUXB5T2lVWG5kRm9sdEQrdzZpT0l6
Z2k1ZkpvQnRzQklSUmYrVGtwTXAzQlpSdUNjc2Q2ZmlGNC9Ha0kKSE1JcHhpUDBrRWo2Smcz
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