summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrett Holman <bholman.devel@gmail.com>2021-11-11 12:04:21 -0700
committerGitHub <noreply@github.com>2021-11-11 13:04:21 -0600
commit22150a20d94cddf2a41073e71a7f0e44bfb4bc51 (patch)
treedb290d6141be8d051b470908875294fa760617c8 /tests
parentfff6de4a18fa4eca709870e995de99c543a4ac1c (diff)
downloadvyos-cloud-init-22150a20d94cddf2a41073e71a7f0e44bfb4bc51.tar.gz
vyos-cloud-init-22150a20d94cddf2a41073e71a7f0e44bfb4bc51.zip
Add convenience symlink to integration test output (#1105)
Integration test runs get unique log directories at /tmp/cloud_init_test_logs/$DATE_TIME. Make /tmp/cloud_init_test_logs/last always point to the most recent integration test directory.
Diffstat (limited to 'tests')
-rw-r--r--tests/integration_tests/conftest.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/integration_tests/conftest.py b/tests/integration_tests/conftest.py
index 5a543e39..68b92e4b 100644
--- a/tests/integration_tests/conftest.py
+++ b/tests/integration_tests/conftest.py
@@ -190,6 +190,15 @@ def _collect_logs(instance: IntegrationInstance, node_id: str,
integration_settings.LOCAL_LOG_PATH
) / session_start_time / node_id_path
log.info("Writing logs to %s", log_dir)
+
+ # Add a symlink to the latest log output directory
+ last_symlink = Path(integration_settings.LOCAL_LOG_PATH) / 'last'
+ if os.path.islink(last_symlink):
+ os.unlink(last_symlink)
+ os.symlink(
+ Path(integration_settings.LOCAL_LOG_PATH) / session_start_time,
+ last_symlink)
+
if not log_dir.exists():
log_dir.mkdir(parents=True)
tarball_path = log_dir / 'cloud-init.tar.gz'