Added dir creation and script for gpg socket dir to default
authorKrista 'DarthMama' Bennett <krista@pep.foundation>
Mon, 28 Jan 2019 14:04:12 +0100
changeset 3246ec48ea509c8d
parent 3232 8a7ab7c488b8
child 3254 6e7f6bc9460a
child 3269 165e254eebd6
Added dir creation and script for gpg socket dir to default
test/RUN_ONCE_AS_SUDO_FOR_TESTS.sh
test/src/EngineTestSuite.cc
test/src/SuiteMaker.cc
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/test/RUN_ONCE_AS_SUDO_FOR_TESTS.sh	Mon Jan 28 14:04:12 2019 +0100
     1.3 @@ -0,0 +1,8 @@
     1.4 +#!/bin/bash
     1.5 +if [[ $EUID > 0 ]]
     1.6 +  then echo "This script must be run with sudo."
     1.7 +  exit
     1.8 +fi
     1.9 +
    1.10 +mkdir -p /run/user/$(id -u $SUDO_USER)
    1.11 +chown $SUDO_USER /run/user/$(id -u $SUDO_USER)
     2.1 --- a/test/src/EngineTestSuite.cc	Wed Jan 23 11:20:24 2019 +0100
     2.2 +++ b/test/src/EngineTestSuite.cc	Mon Jan 28 14:04:12 2019 +0100
     2.3 @@ -214,8 +214,12 @@
     2.4      
     2.5  //    cout << "calling init()\n";
     2.6      PEP_STATUS status = init(&session);
     2.7 +#ifndef USE_NETPGP            
     2.8 +    success = system("gpgconf --create-socketdir");
     2.9 +    if (success != 0)
    2.10 +        throw std::runtime_error("RESTORE: Error when executing 'gpgconf --create-socketdir'.");            
    2.11      system("gpg-connect-agent /bye");   // Just in case - otherwise, we die on MacOS sometimes. Is this enough??
    2.12 -
    2.13 +#endif 
    2.14      assert(status == PEP_STATUS_OK);
    2.15      assert(session);
    2.16  //    cout << "init() completed.\n";
    2.17 @@ -232,6 +236,9 @@
    2.18      success = system("gpgconf --kill all");
    2.19      if (success != 0)
    2.20          throw std::runtime_error("RESTORE: Error when executing 'gpgconf --kill all'.");
    2.21 +    success = system("gpgconf --remove-socketdir");            
    2.22 +    if (success != 0)
    2.23 +        throw std::runtime_error("RESTORE: Error when executing 'gpgconf --remove-socketdir'.");
    2.24  #endif
    2.25  
    2.26      success = setenv("GNUPGHOME", prev_pgp_home.c_str(), 1);
     3.1 --- a/test/src/SuiteMaker.cc	Wed Jan 23 11:20:24 2019 +0100
     3.2 +++ b/test/src/SuiteMaker.cc	Mon Jan 28 14:04:12 2019 +0100
     3.3 @@ -29,6 +29,7 @@
     3.4  #include "PgpListKeysTests.h"
     3.5  #include "MessageApiTests.h"
     3.6  #include "EncryptMissingPrivateKeyTests.h"
     3.7 +#include "NetPGPPlaygroundTests.h"
     3.8  #include "CaseAndDotAddressTests.h"
     3.9  #include "UserIDAliasTests.h"
    3.10  #include "BCCTests.h"
    3.11 @@ -77,6 +78,7 @@
    3.12      "PgpListKeysTests",
    3.13      "MessageApiTests",
    3.14      "EncryptMissingPrivateKeyTests",
    3.15 +    "NetPGPPlaygroundTests",
    3.16      "CaseAndDotAddressTests",
    3.17      "UserIDAliasTests",
    3.18      "BCCTests",
    3.19 @@ -108,7 +110,7 @@
    3.20  };
    3.21  
    3.22  // This file is generated, so magic constants are ok.
    3.23 -int SuiteMaker::num_suites = 45;
    3.24 +int SuiteMaker::num_suites = 46;
    3.25  
    3.26  void SuiteMaker::suitemaker_build(const char* test_class_name, const char* test_home, Test::Suite** test_suite) {
    3.27      if (strcmp(test_class_name, "MimeTests") == 0)
    3.28 @@ -145,6 +147,8 @@
    3.29          *test_suite = new MessageApiTests(test_class_name, test_home);
    3.30      else if (strcmp(test_class_name, "EncryptMissingPrivateKeyTests") == 0)
    3.31          *test_suite = new EncryptMissingPrivateKeyTests(test_class_name, test_home);
    3.32 +    else if (strcmp(test_class_name, "NetPGPPlaygroundTests") == 0)
    3.33 +        *test_suite = new NetPGPPlaygroundTests(test_class_name, test_home);
    3.34      else if (strcmp(test_class_name, "CaseAndDotAddressTests") == 0)
    3.35          *test_suite = new CaseAndDotAddressTests(test_class_name, test_home);
    3.36      else if (strcmp(test_class_name, "UserIDAliasTests") == 0)