Added dir creation and script for gpg socket dir to default

doc_update_sequoia
parent 763ad06856
commit 94f30a8645

@ -0,0 +1,8 @@
#!/bin/bash
if [[ $EUID > 0 ]]
then echo "This script must be run with sudo."
exit
fi
mkdir -p /run/user/$(id -u $SUDO_USER)
chown $SUDO_USER /run/user/$(id -u $SUDO_USER)

@ -214,8 +214,12 @@ void EngineTestSuite::set_full_env(const char* gpg_conf_copy_path, const char* g
// cout << "calling init()\n";
PEP_STATUS status = init(&session);
#ifndef USE_NETPGP
success = system("gpgconf --create-socketdir");
if (success != 0)
throw std::runtime_error("RESTORE: Error when executing 'gpgconf --create-socketdir'.");
system("gpg-connect-agent /bye"); // Just in case - otherwise, we die on MacOS sometimes. Is this enough??
#endif
assert(status == PEP_STATUS_OK);
assert(session);
// cout << "init() completed.\n";
@ -232,6 +236,9 @@ void EngineTestSuite::restore_full_env() {
success = system("gpgconf --kill all");
if (success != 0)
throw std::runtime_error("RESTORE: Error when executing 'gpgconf --kill all'.");
success = system("gpgconf --remove-socketdir");
if (success != 0)
throw std::runtime_error("RESTORE: Error when executing 'gpgconf --remove-socketdir'.");
#endif
success = setenv("GNUPGHOME", prev_pgp_home.c_str(), 1);

@ -29,6 +29,7 @@
#include "PgpListKeysTests.h"
#include "MessageApiTests.h"
#include "EncryptMissingPrivateKeyTests.h"
#include "NetPGPPlaygroundTests.h"
#include "CaseAndDotAddressTests.h"
#include "UserIDAliasTests.h"
#include "BCCTests.h"
@ -77,6 +78,7 @@ const char* SuiteMaker::all_suites[] = {
"PgpListKeysTests",
"MessageApiTests",
"EncryptMissingPrivateKeyTests",
"NetPGPPlaygroundTests",
"CaseAndDotAddressTests",
"UserIDAliasTests",
"BCCTests",
@ -108,7 +110,7 @@ const char* SuiteMaker::all_suites[] = {
};
// This file is generated, so magic constants are ok.
int SuiteMaker::num_suites = 45;
int SuiteMaker::num_suites = 46;
void SuiteMaker::suitemaker_build(const char* test_class_name, const char* test_home, Test::Suite** test_suite) {
if (strcmp(test_class_name, "MimeTests") == 0)
@ -145,6 +147,8 @@ void SuiteMaker::suitemaker_build(const char* test_class_name, const char* test_
*test_suite = new MessageApiTests(test_class_name, test_home);
else if (strcmp(test_class_name, "EncryptMissingPrivateKeyTests") == 0)
*test_suite = new EncryptMissingPrivateKeyTests(test_class_name, test_home);
else if (strcmp(test_class_name, "NetPGPPlaygroundTests") == 0)
*test_suite = new NetPGPPlaygroundTests(test_class_name, test_home);
else if (strcmp(test_class_name, "CaseAndDotAddressTests") == 0)
*test_suite = new CaseAndDotAddressTests(test_class_name, test_home);
else if (strcmp(test_class_name, "UserIDAliasTests") == 0)

Loading…
Cancel
Save