Browse Source

fixing ENGINE-453

ENGINE-454
Volker Birk 3 years ago
parent
commit
f5a71846c5
5 changed files with 15 additions and 14 deletions
  1. +1
    -1
      test/convenience_scripts/DANGER_delete_keys_silently_w_pattern.py
  2. +1
    -1
      test/convenience_scripts/keygen_for_test.py
  3. +1
    -1
      test/python_tests/setup_test.py
  4. +2
    -2
      test/python_tests/test_handshake.py
  5. +10
    -9
      test/src/EngineTestSuite.cc

+ 1
- 1
test/convenience_scripts/DANGER_delete_keys_silently_w_pattern.py View File

@ -9,7 +9,7 @@ parser.add_argument("--priv", "-p", help="also delete associated private keys",
args = parser.parse_args()
homedir = os.path.join(os.path.expanduser('~'),".gnupg")
homedir = os.path.join(os.path.expanduser('~'),"gnupg")
print("GNUPGHOME=" + homedir + "\n")
try:


+ 1
- 1
test/convenience_scripts/keygen_for_test.py View File

@ -16,7 +16,7 @@ args = parser.parse_args()
pub_path = os.path.join(args.output_root, "pub")
priv_path = os.path.join(args.output_root, "priv")
homedir = os.path.join(os.path.expanduser('~'),".gnupg")
homedir = os.path.join(os.path.expanduser('~'),"gnupg")
print("GNUPGHOME=" + homedir + "\n")
try:


+ 1
- 1
test/python_tests/setup_test.py View File

@ -38,7 +38,7 @@ def create_own_identities(mydir, arthome, username):
"create own identities as part of the test setup"
os.environ["HOME"] = os.path.join(mydir, arthome)
os.environ["GNUPGHOME"] = os.path.join(mydir, arthome, '.gnupg')
os.environ["GNUPGHOME"] = os.path.join(mydir, arthome, 'gnupg')
import pEp
me = pEp.Identity()


+ 2
- 2
test/python_tests/test_handshake.py View File

@ -20,7 +20,7 @@ class Test1:
arthome = "test1"
os.environ["HOME"] = os.path.join(mydir, arthome)
os.environ["GNUPGHOME"] = os.path.join(mydir, arthome, '.gnupg')
os.environ["GNUPGHOME"] = os.path.join(mydir, arthome, 'gnupg')
os.chdir(os.path.join(mydir, arthome))
@ -79,7 +79,7 @@ class Test2:
arthome = "test2"
os.environ["HOME"] = os.path.join(mydir, arthome)
os.environ["GNUPGHOME"] = os.path.join(mydir, arthome, '.gnupg')
os.environ["GNUPGHOME"] = os.path.join(mydir, arthome, 'gnupg')
os.chdir(os.path.join(mydir, arthome))


+ 10
- 9
test/src/EngineTestSuite.cc View File

@ -85,23 +85,23 @@ void EngineTestSuite::set_full_env() {
cout << "home is " << home << endl;
assert(temp_test_home.compare(home) != 0);
assert(temp_test_home.compare(home + "/") != 0);
assert(temp_test_home.compare(home + "/.gnupg") != 0);
assert(temp_test_home.compare(home + ".gnupg") != 0);
assert(temp_test_home.compare(home + "/gnupg") != 0);
assert(temp_test_home.compare(home + "gnupg") != 0);
assert(temp_test_home.compare(prev_gpg_home) != 0);
assert(temp_test_home.compare(prev_gpg_home + "/.gnupg") != 0);
assert(temp_test_home.compare(prev_gpg_home + ".gnupg") != 0);
assert(temp_test_home.compare(prev_gpg_home + "/gnupg") != 0);
assert(temp_test_home.compare(prev_gpg_home + "gnupg") != 0);
if (temp_test_home.compare(home) == 0 || temp_test_home.compare(home + "/") == 0 ||
temp_test_home.compare(home + "/.gnupg") == 0 || temp_test_home.compare(home + ".gnupg") == 0 ||
temp_test_home.compare(prev_gpg_home) == 0 || temp_test_home.compare(prev_gpg_home + "/.gnupg") == 0 ||
temp_test_home.compare(prev_gpg_home + ".gnupg") == 0)
temp_test_home.compare(home + "/gnupg") == 0 || temp_test_home.compare(home + "gnupg") == 0 ||
temp_test_home.compare(prev_gpg_home) == 0 || temp_test_home.compare(prev_gpg_home + "/gnupg") == 0 ||
temp_test_home.compare(prev_gpg_home + "gnupg") == 0)
throw std::runtime_error("SETUP: new GNUPGHOME threatens to mess up user GNUPGHOME (and delete all their keys). NO DICE.");
// cout << "Ok - checked if new test home will be safe. We'll try and make the directory, deleting it if it has already exists." << endl;
struct stat buf;
success = setenv("GNUPGHOME", (temp_test_home + "/.gnupg").c_str(), 1);
success = setenv("GNUPGHOME", (temp_test_home + "/gnupg").c_str(), 1);
if (success != 0)
throw std::runtime_error("SETUP: Error when setting GNUPGHOME.");
@ -156,4 +156,5 @@ void EngineTestSuite::tear_down() {}
void EngineTestSuite::set_my_name() {
my_name = typeid(*this).name();
}
}

Loading…
Cancel
Save