summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNaveen Joy <najoy@cisco.com>2022-09-20 11:38:33 -0700
committerDave Wallace <dwallacelf@gmail.com>2022-10-11 23:19:30 +0000
commit7498aadd23eb4d5be2891041c9153cc5dff1a6cc (patch)
tree603254241e8bb383fe1db3298137678ea06ec8aa
parent6531cf5d1cffab8690c42847eef4f00f3018bb70 (diff)
tests: don't use tmp as the default log dir with run.py
The log file directory is configurable with run.py using the --log-dir argument. This patch removes the use of /tmp as the default dir for storing all test logs. The default log dir is now set to show the year, month and day of the test run. This provides a more meaningful aggregation of test logs for effective troubleshooting. The default log dir is set to <CWD>/test-run-YYYY-MM-DD. Type: improvement Change-Id: I6c9002e961f6e06fc953ca42d86febf4f218e566 Signed-off-by: Naveen Joy <najoy@cisco.com>
-rw-r--r--.gitignore4
-rwxr-xr-xtest/run.py6
2 files changed, 8 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 06c57c3cb85..aba513c91e5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -119,3 +119,7 @@ compile_commands.json
# debian packaging
.pc
+
+# No test log files
+**/test-run-*-*-*
+
diff --git a/test/run.py b/test/run.py
index 646354ab060..ddb79950b85 100755
--- a/test/run.py
+++ b/test/run.py
@@ -25,6 +25,7 @@ from subprocess import Popen, PIPE, STDOUT, call
import sys
import time
import venv
+import datetime
# Required Std. Path Variables
@@ -300,6 +301,7 @@ def run_tests_in_venv(
f"--filter={test}",
f"--jobs={jobs}",
f"--log-dir={log_dir}",
+ f"--tmp-dir={log_dir}",
]
if running_vpp:
args = args + [f"--use-running-vpp"]
@@ -376,9 +378,9 @@ if __name__ == "__main__":
parser.add_argument(
"--log-dir",
action="store",
- default="/tmp",
+ default=os.path.abspath(f"./test-run-{datetime.date.today()}"),
help="directory where to store directories "
- "containing log files (default: /tmp)",
+ "containing log files (default: ./test-run-YYYY-MM-DD)",
)
parser.add_argument(
"--jobs",