From 4c58307fa42cd3032b95686f5130aa9ae80920a8 Mon Sep 17 00:00:00 2001
From: Florian Spreckelsen <f.spreckelsen@indiscale.com>
Date: Thu, 28 Nov 2024 14:19:52 +0100
Subject: [PATCH] TST: Adapt setup for authtokens

---
 .gitignore                                   |  1 +
 pylinkahead.ini.template                     | 15 ++++++---------
 resources/subdir/.add_dir_to_git             |  1 +
 test_profile/paths/authtoken/.add_dir_to_git |  1 +
 test_profile/profile.yml                     |  2 ++
 5 files changed, 11 insertions(+), 9 deletions(-)
 create mode 100644 resources/subdir/.add_dir_to_git
 create mode 100644 test_profile/paths/authtoken/.add_dir_to_git

diff --git a/.gitignore b/.gitignore
index 99735f7..5d0b87b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,3 +19,4 @@ PyCaosDB*.egg
 pycaosdb.ini
 pylinkahead.ini
 *~
+/test_profile/paths/authtoken/admin_token*
diff --git a/pylinkahead.ini.template b/pylinkahead.ini.template
index 5770cbe..439f8c1 100644
--- a/pylinkahead.ini.template
+++ b/pylinkahead.ini.template
@@ -7,11 +7,6 @@
 ## to point to existing directories in which the CaosDB server has the
 ## permissions to create and execute scripts.
 
-# Location of a temp dir into which the server-side scripts can be
-# copied during the SSS tests. This is not needed; the tests will use
-# /tmp/... if none is given.
-# test_server_side_scripting.bin_dir.local=/path/to/linkahead-pyinttest/sss-temp/
-
 # Location of the scripting bin debug dir which is used for the test
 # scripts from the server's perspective.
 test_server_side_scripting.bin_dir.server=/opt/caosdb/git/caosdb-server/scripting/bin-debug
@@ -30,10 +25,12 @@ test_files.test_insert_files_in_dir.local=/path/to/linkahead-pyinttest/test_prof
 test_files.test_insert_files_in_dir.server=/opt/caosdb/mnt/extroot/test_insert_files_in_dir/
 
 ########## Authentication tokens ##################
-# # location of the one-time tokens from the pyinttest's perspective
-# test_authentication.admin_token_crud = /authtoken/admin_token_crud.txt
-# test_authentication.admin_token_expired = /authtoken/admin_token_expired.txt
-# test_authentication.admin_token_3_attempts = /authtoken/admin_token_3_attempts.txt
+# location of the one-time tokens from the pyinttest's
+# perspective. When using the test_profile, the parent directory has
+# to be the same as the value of `debug_token_auth_dir`
+test_authentication.admin_token_crud = /tmp/linkahead-pyinttest/authtoken/admin_token_crud.txt
+test_authentication.admin_token_expired = /tmp/linkahead-pyinttest/authtoken/admin_token_expired.txt
+test_authentication.admin_token_3_attempts = /tmp/linkahead-pyinttest/authtoken/admin_token_3_attempts.txt
 
 # Needed for one time-zone test
 test_misc.test_time_zone.time_zone = Cuba
diff --git a/resources/subdir/.add_dir_to_git b/resources/subdir/.add_dir_to_git
new file mode 100644
index 0000000..c51a03a
--- /dev/null
+++ b/resources/subdir/.add_dir_to_git
@@ -0,0 +1 @@
+This directory should be created when cloning or pulling this git repository.
diff --git a/test_profile/paths/authtoken/.add_dir_to_git b/test_profile/paths/authtoken/.add_dir_to_git
new file mode 100644
index 0000000..c51a03a
--- /dev/null
+++ b/test_profile/paths/authtoken/.add_dir_to_git
@@ -0,0 +1 @@
+This directory should be created when cloning or pulling this git repository.
diff --git a/test_profile/profile.yml b/test_profile/profile.yml
index 1bb66d3..388cc71 100644
--- a/test_profile/profile.yml
+++ b/test_profile/profile.yml
@@ -31,6 +31,7 @@ default:
     # - debug-scripting-bin :: Used as the server-side scripting bin dir.
     # debug: false
     debug: true
+    debug_authtoken_dir: "/tmp/linkahead-pyinttest/authtoken/"
     # URL of the docker registry.  Set to "" to look locally.
     # registry_server: "gitlab.indiscale.com:5050"
     # The account for accessing the registry server.  "" means no account.
@@ -93,6 +94,7 @@ default:
         # database.
         _CAOSDB_INTEGRATION_TEST_SUITE_KEY: "_CAOSDB_PYINTTEST_SUITE"
         TRANSACTION_BENCHMARK_ENABLED: "TRUE"
+        # SERVER_SIDE_SCRIPTING_BIN_DIRS: ""
 
         # HTTPS port of the grpc end-point
         # grpc_server_port_https: 8443
-- 
GitLab