From 94e630d1147d4c002447244a88053902d1258c73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Haziza?= Date: Thu, 11 Jul 2024 11:52:32 +0200 Subject: [PATCH] Changing the expiration date to work with Linux and MacOS --- tests/expiration.bats | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/expiration.bats b/tests/expiration.bats index 9a8b995..fef1852 100644 --- a/tests/expiration.bats +++ b/tests/expiration.bats @@ -20,7 +20,7 @@ function teardown() { # Bob encrypts the testfile for Alice export C4GH_PASSPHRASE=${BOB_PASSPHRASE} - EXP_DATE=$(date -Iseconds -jf %s $(( $(date +%s) - 86400 * 2 ))) + EXP_DATE=$(python -c 'import time,datetime; print(datetime.datetime.fromtimestamp(time.time() - 86400 * 2).isoformat())') crypt4gh encrypt --recipient_pk ${ALICE_PUBKEY} --expiration "${EXP_DATE}" < $TESTFILE > $TESTFILES/message.c4gh # Alice decrypts it @@ -38,7 +38,7 @@ function teardown() { # Bob encrypts the testfile for Alice export C4GH_PASSPHRASE=${BOB_PASSPHRASE} - EXP_DATE=$(date -Iseconds -jf %s $(( $(date +%s) + 86400 * 2 ))) + EXP_DATE=$(python -c 'import time,datetime; print(datetime.datetime.fromtimestamp(time.time() + 86400 * 2).isoformat())') crypt4gh encrypt --sk ${BOB_SECKEY} --recipient_pk ${ALICE_PUBKEY} --expiration "${EXP_DATE}" < $TESTFILE > $TESTFILES/message.c4gh # Alice decrypts it