Download access point systemd journal after test
Attach the systemd journal logs in the artifacts of every antlion test.
This assists future debugging.
Change-Id: I76ada3f547a3730811a9d088771ce3e09bfecc2a
Reviewed-on: https://fuchsia-review.googlesource.com/c/antlion/+/1044798
Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com>
Fuchsia-Auto-Submit: Sam Balana <sbalana@google.com>
Reviewed-by: Anthonio Saw <anthonio@google.com>
diff --git a/packages/antlion/controllers/access_point.py b/packages/antlion/controllers/access_point.py
index 9a1f227..d1656f5 100755
--- a/packages/antlion/controllers/access_point.py
+++ b/packages/antlion/controllers/access_point.py
@@ -369,6 +369,10 @@
if self._dhcp is not None:
self._dhcp.stop()
+ def get_systemd_journal(self) -> str:
+ """Get systemd journal logs from this current boot."""
+ return self.ssh.run(f"journalctl --boot").stdout
+
def get_dhcp_logs(self) -> str | None:
"""Get DHCP logs for this AP object.
diff --git a/packages/antlion/test_utils/wifi/base_test.py b/packages/antlion/test_utils/wifi/base_test.py
index 8599c11..e7bc4e7 100644
--- a/packages/antlion/test_utils/wifi/base_test.py
+++ b/packages/antlion/test_utils/wifi/base_test.py
@@ -265,6 +265,13 @@
with open(radvd_log_path, "a") as f:
f.write(radvd_log)
+ systemd_journal = access_point.get_systemd_journal()
+ systemd_journal_path = os.path.join(
+ current_path, f"{access_point.identifier}_systemd_journal.txt"
+ )
+ with open(systemd_journal_path, "a") as f:
+ f.write(systemd_journal)
+
def get_psk_network(
self,
mirror_ap: bool,