Fix and reenable rlz_CheckPing.guest

The default initialization for chrome.py's Chrome session causes it to
delete /home/chronos/'Local State' which is the primary source for
looking up the RLZ brand code. When it's missing, the rlz_brand_code VPD
value is referred to instead. Unibuild models do not have this VPD entry
though, so no RLZ brand code is found which results in the ping not
being sent. /home/chronos/'Local State' is not normally deleted between
regular user and guest logins, so the test still accurately tracks the
manual test.

BUG=chromium:1048226
TEST=test_that <ip> rlz_CheckPing.guest -b <board> --no-retry --autotest_dir ~/trunk/src/third_party/autotest/files on a few unibuild + non-unibuild boards.

Change-Id: I53630c5cfeb3618c794d4e8065eb8709610c3c5d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2577059
Tested-by: Kyle Shimabukuro <kyleshima@chromium.org>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Commit-Queue: Kyle Shimabukuro <kyleshima@chromium.org>
diff --git a/client/site_tests/desktopui_CheckRlzPingSent/desktopui_CheckRlzPingSent.py b/client/site_tests/desktopui_CheckRlzPingSent/desktopui_CheckRlzPingSent.py
index 5c63a18..598ff87 100644
--- a/client/site_tests/desktopui_CheckRlzPingSent/desktopui_CheckRlzPingSent.py
+++ b/client/site_tests/desktopui_CheckRlzPingSent/desktopui_CheckRlzPingSent.py
@@ -162,9 +162,17 @@
                     self._wait_for_rlz_lock()
 
         logging.debug("Starting RLZ check with username flag: %s", username)
-        with chrome.Chrome(logged_in=pre_login is not 'lock',
-                           extra_browser_args=browser_args, username=username,
-                           dont_override_profile=True) as cr:
+        # Pass clear_enterprise_policy=False in guest mode to avoid deleting
+        # /home/chronos/'Local State' between logins. Deleting it will cause
+        # the guest mode test to fail on boards that do not have rlz_brand_code
+        # in the VPD (mainly unibuild models). This file is normally not
+        # deleted between logins anyways.
+        with chrome.Chrome(
+                logged_in=pre_login is not 'lock',
+                clear_enterprise_policy=pre_login is not 'lock',
+                extra_browser_args=browser_args,
+                username=username,
+                dont_override_profile=True) as cr:
             self._check_url_for_rlz(cr)
             self._verify_rlz_data(expect_caf_ping=expect_caf_ping,
                                   guest=pre_login is 'lock')
diff --git a/server/site_tests/rlz_CheckPing/control.guest b/server/site_tests/rlz_CheckPing/control.guest
index bc650ef..e4f6acc 100644
--- a/server/site_tests/rlz_CheckPing/control.guest
+++ b/server/site_tests/rlz_CheckPing/control.guest
@@ -9,8 +9,7 @@
 TEST_CATEGORY = "Functional"
 TEST_CLASS = "platform"
 TEST_TYPE = "server"
-# Disable this test until it is passing at least 90% of the time: https://crbug.com/1048226
-# ATTRIBUTES = "suite:rlz"
+ATTRIBUTES = "suite:rlz"
 DOC = """
 This tests the RLZ client install (CAI) and first-use event (CAF) pings are
 sent on first use of the device in guest mode, as long as the device has been