autotest: Make sure the destination directory exists before upload profile

BUG=None
TEST=unittest

Change-Id: I375f55e1be8b4f082abf2566aa01a5cb700edcc6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2417231
Tested-by: Garry Wang <xianuowang@chromium.org>
Reviewed-by: Otabek Kasimov <otabek@google.com>
Commit-Queue: Garry Wang <xianuowang@chromium.org>
diff --git a/server/cros/device_health_profile/device_health_profile.py b/server/cros/device_health_profile/device_health_profile.py
index bb2073b..9650267 100644
--- a/server/cros/device_health_profile/device_health_profile.py
+++ b/server/cros/device_health_profile/device_health_profile.py
@@ -100,6 +100,10 @@
     def _upload_profile(self):
         """Copy profile file from local path to remote profile host.
         """
+        # Make sure the device health profile directory exists on profile host.
+        self._profile_host.run('mkdir -p %s' % PROFILE_FILE_DIR,
+                               ignore_status=True)
+
         logging.debug('Uploading profile from local path: %s to remote %s:%s',
                       self._local_path,
                       self._profile_host.hostname,