Qemu: Ensure ART_SSH_CMD is defined when running tests am: 5b2f97b131

Original change: https://android-review.googlesource.com/c/platform/art/+/2977711

Change-Id: I557e66ffe9c20f8ff58cf6b9b6737df61a920166
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/test/run-test b/test/run-test
index de676a0..95af20c 100755
--- a/test/run-test
+++ b/test/run-test
@@ -114,10 +114,10 @@
   checker = f"{progdir}/../tools/checker/checker.py"
 
   ON_VM = os.environ.get("ART_TEST_ON_VM")
-  SSH_USER = os.environ.get("ART_TEST_SSH_USER")
-  SSH_HOST = os.environ.get("ART_TEST_SSH_HOST")
-  SSH_PORT = os.environ.get("ART_TEST_SSH_PORT")
-  SSH_CMD = os.environ.get("ART_SSH_CMD")
+  SSH_USER = env.ART_TEST_SSH_USER
+  SSH_HOST = env.ART_TEST_SSH_HOST
+  SSH_PORT = env.ART_TEST_SSH_PORT
+  SSH_CMD = env.ART_SSH_CMD
   SCP_CMD = os.environ.get("ART_SCP_CMD")
   CHROOT = os.environ.get("ART_TEST_CHROOT")
   CHROOT_CMD = os.environ.get("ART_CHROOT_CMD")
diff --git a/test/testrunner/env.py b/test/testrunner/env.py
index 200de4a..75d62eb 100644
--- a/test/testrunner/env.py
+++ b/test/testrunner/env.py
@@ -148,4 +148,10 @@
 ART_TEST_RUN_ON_ARM_FVP = _getEnvBoolean('ART_TEST_RUN_ON_ARM_FVP', False)
 
 ART_TEST_ON_VM = _env.get('ART_TEST_ON_VM')
-ART_SSH_CMD = _env.get('ART_SSH_CMD')
+
+ART_TEST_SSH_PORT = _env.get('ART_TEST_SSH_PORT', 10001)
+ART_TEST_SSH_USER = _env.get('ART_TEST_SSH_USER', 'ubuntu')
+ART_TEST_SSH_HOST = _env.get('ART_TEST_SSH_HOST', 'localhost')
+ART_SSH_CMD = _env.get('ART_SSH_CMD', f"ssh -q -i ~/.ssh/ubuntu -p {ART_TEST_SSH_PORT} "
+                                      f"-o StrictHostKeyChecking=no "
+                                      f"{ART_TEST_SSH_USER}@{ART_TEST_SSH_HOST}")