src/EngineTestSuite.cc sync
authorKrista 'DarthMama' Bennett <krista@pep.foundation>
Mon, 28 Jan 2019 13:42:25 +0100
branchsync
changeset 3244bf242e94441c
parent 3234 538a03bab6b8
child 3245 4ef46e3bb562
src/EngineTestSuite.cc
test/Makefile
test/RUN_ONCE_AS_SUDO_FOR_TESTS.sh
test/src/EngineTestSuite.cc
test/src/SuiteMaker.cc
     1.1 --- a/test/Makefile	Wed Jan 23 11:23:09 2019 +0100
     1.2 +++ b/test/Makefile	Mon Jan 28 13:42:25 2019 +0100
     1.3 @@ -20,7 +20,7 @@
     1.4  INC_DIRS := ./include /usr/local/include ../src ../sync ../asn.1
     1.5  INC_FLAGS := $(addprefix -I,$(INC_DIRS)) $(GPGME_INC) $(CPPUNIT_INC)
     1.6  
     1.7 -LDFLAGS += -L/usr/local/lib
     1.8 +LDFLAGS += -L/usr/local/lib -L/opt/local/lib
     1.9  
    1.10  CFLAGS += -Wno-deprecated
    1.11  CXXFLAGS += -Wno-deprecated
    1.12 @@ -34,7 +34,7 @@
    1.13  endif
    1.14  
    1.15  ifeq ($(OPENPGP),NETPGP)
    1.16 -	LDLIBS+= -lnetpgp
    1.17 +	LDLIBS+= -lnetpgp -lcrypto
    1.18  	CFLAGS+= -DUSE_NETPGP
    1.19  ifeq ($(BUILD_FOR),Linux)
    1.20  	LDLIBS+= -ltre
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/test/RUN_ONCE_AS_SUDO_FOR_TESTS.sh	Mon Jan 28 13:42:25 2019 +0100
     2.3 @@ -0,0 +1,8 @@
     2.4 +#!/bin/bash
     2.5 +if [[ $EUID > 0 ]]
     2.6 +  then echo "This script must be run with sudo."
     2.7 +  exit
     2.8 +fi
     2.9 +
    2.10 +mkdir -p /run/user/$(id -u $SUDO_USER)
    2.11 +chown $SUDO_USER /run/user/$(id -u $SUDO_USER)
     3.1 --- a/test/src/EngineTestSuite.cc	Wed Jan 23 11:23:09 2019 +0100
     3.2 +++ b/test/src/EngineTestSuite.cc	Mon Jan 28 13:42:25 2019 +0100
     3.3 @@ -216,7 +216,12 @@
     3.4      
     3.5  //    cout << "calling init()\n";
     3.6      PEP_STATUS status = init(&session, cached_messageToSend, cached_inject_sync_event);
     3.7 +#ifndef USE_NETPGP            
     3.8 +    success = system("gpgconf --create-socketdir");
     3.9 +    if (success != 0)
    3.10 +        throw std::runtime_error("RESTORE: Error when executing 'gpgconf --create-socketdir'.");        
    3.11      system("gpg-connect-agent /bye");   // Just in case - otherwise, we die on MacOS sometimes. Is this enough??
    3.12 +#endif
    3.13  
    3.14      assert(status == PEP_STATUS_OK);
    3.15      assert(session);
    3.16 @@ -234,6 +239,9 @@
    3.17      success = system("gpgconf --kill all");
    3.18      if (success != 0)
    3.19          throw std::runtime_error("RESTORE: Error when executing 'gpgconf --kill all'.");
    3.20 +    success = system("gpgconf --remove-socketdir");            
    3.21 +    if (success != 0)
    3.22 +        throw std::runtime_error("RESTORE: Error when executing 'gpgconf --remove-socketdir'.");    
    3.23  #endif
    3.24  
    3.25      success = setenv("GNUPGHOME", prev_pgp_home.c_str(), 1);
     4.1 --- a/test/src/SuiteMaker.cc	Wed Jan 23 11:23:09 2019 +0100
     4.2 +++ b/test/src/SuiteMaker.cc	Mon Jan 28 13:42:25 2019 +0100
     4.3 @@ -21,7 +21,6 @@
     4.4  #include "I18nTests.h"
     4.5  #include "IdentityListTests.h"
     4.6  #include "PgpBinaryTests.h"
     4.7 -#include "MistrustUndoTests.h"
     4.8  #include "SubkeyRatingEvalTests.h"
     4.9  #include "MessageNullFromTests.h"
    4.10  #include "LeastCommonDenomColorTests.h"
    4.11 @@ -29,8 +28,10 @@
    4.12  #include "PgpListKeysTests.h"
    4.13  #include "MessageApiTests.h"
    4.14  #include "EncryptMissingPrivateKeyTests.h"
    4.15 +#include "NetPGPPlaygroundTests.h"
    4.16  #include "CaseAndDotAddressTests.h"
    4.17  #include "UserIDAliasTests.h"
    4.18 +#include "SignOnlyTests.h"
    4.19  #include "BCCTests.h"
    4.20  #include "Engine358Tests.h"
    4.21  #include "BlacklistAcceptNewKeyTests.h"
    4.22 @@ -55,6 +56,7 @@
    4.23  #include "CrashdumpTests.h"
    4.24  #include "StringpairListTests.h"
    4.25  #include "EncryptForIdentityTests.h"
    4.26 +#include "KeyResetMessageTests.h"
    4.27  #include "TrustManipulationTests.h"
    4.28  #include "AppleMailTests.h"
    4.29  
    4.30 @@ -69,7 +71,6 @@
    4.31      "I18nTests",
    4.32      "IdentityListTests",
    4.33      "PgpBinaryTests",
    4.34 -    "MistrustUndoTests",
    4.35      "SubkeyRatingEvalTests",
    4.36      "MessageNullFromTests",
    4.37      "LeastCommonDenomColorTests",
    4.38 @@ -77,8 +78,10 @@
    4.39      "PgpListKeysTests",
    4.40      "MessageApiTests",
    4.41      "EncryptMissingPrivateKeyTests",
    4.42 +    "NetPGPPlaygroundTests",
    4.43      "CaseAndDotAddressTests",
    4.44      "UserIDAliasTests",
    4.45 +    "SignOnlyTests",
    4.46      "BCCTests",
    4.47      "Engine358Tests",
    4.48      "BlacklistAcceptNewKeyTests",
    4.49 @@ -103,12 +106,13 @@
    4.50      "CrashdumpTests",
    4.51      "StringpairListTests",
    4.52      "EncryptForIdentityTests",
    4.53 +    "KeyResetMessageTests",
    4.54      "TrustManipulationTests",
    4.55      "AppleMailTests",
    4.56  };
    4.57  
    4.58  // This file is generated, so magic constants are ok.
    4.59 -int SuiteMaker::num_suites = 45;
    4.60 +int SuiteMaker::num_suites = 47;
    4.61  
    4.62  void SuiteMaker::suitemaker_build(const char* test_class_name, const char* test_home, Test::Suite** test_suite) {
    4.63      if (strcmp(test_class_name, "MimeTests") == 0)
    4.64 @@ -129,8 +133,6 @@
    4.65          *test_suite = new IdentityListTests(test_class_name, test_home);
    4.66      else if (strcmp(test_class_name, "PgpBinaryTests") == 0)
    4.67          *test_suite = new PgpBinaryTests(test_class_name, test_home);
    4.68 -    else if (strcmp(test_class_name, "MistrustUndoTests") == 0)
    4.69 -        *test_suite = new MistrustUndoTests(test_class_name, test_home);
    4.70      else if (strcmp(test_class_name, "SubkeyRatingEvalTests") == 0)
    4.71          *test_suite = new SubkeyRatingEvalTests(test_class_name, test_home);
    4.72      else if (strcmp(test_class_name, "MessageNullFromTests") == 0)
    4.73 @@ -145,10 +147,14 @@
    4.74          *test_suite = new MessageApiTests(test_class_name, test_home);
    4.75      else if (strcmp(test_class_name, "EncryptMissingPrivateKeyTests") == 0)
    4.76          *test_suite = new EncryptMissingPrivateKeyTests(test_class_name, test_home);
    4.77 +    else if (strcmp(test_class_name, "NetPGPPlaygroundTests") == 0)
    4.78 +        *test_suite = new NetPGPPlaygroundTests(test_class_name, test_home);
    4.79      else if (strcmp(test_class_name, "CaseAndDotAddressTests") == 0)
    4.80          *test_suite = new CaseAndDotAddressTests(test_class_name, test_home);
    4.81      else if (strcmp(test_class_name, "UserIDAliasTests") == 0)
    4.82          *test_suite = new UserIDAliasTests(test_class_name, test_home);
    4.83 +    else if (strcmp(test_class_name, "SignOnlyTests") == 0)
    4.84 +        *test_suite = new SignOnlyTests(test_class_name, test_home);
    4.85      else if (strcmp(test_class_name, "BCCTests") == 0)
    4.86          *test_suite = new BCCTests(test_class_name, test_home);
    4.87      else if (strcmp(test_class_name, "Engine358Tests") == 0)
    4.88 @@ -197,6 +203,8 @@
    4.89          *test_suite = new StringpairListTests(test_class_name, test_home);
    4.90      else if (strcmp(test_class_name, "EncryptForIdentityTests") == 0)
    4.91          *test_suite = new EncryptForIdentityTests(test_class_name, test_home);
    4.92 +    else if (strcmp(test_class_name, "KeyResetMessageTests") == 0)
    4.93 +        *test_suite = new KeyResetMessageTests(test_class_name, test_home);
    4.94      else if (strcmp(test_class_name, "TrustManipulationTests") == 0)
    4.95          *test_suite = new TrustManipulationTests(test_class_name, test_home);
    4.96      else if (strcmp(test_class_name, "AppleMailTests") == 0)