platform_EncryptedStateful: remove factory mode from the test

Factory mode was removed in CL:1636176, which caused the test
platform_EncryptedStateful to fail. Removed factory mode from the test and
replace it with a reclamation test.

BUG=b:131123943
TEST=run `test_that <dut_ip> platform_EncryptedStateful` on a local soraka
     before and after this change. It's failing before the change and passing
     now.

Change-Id: Ie3932e0fa09ccbca05576fa61f9947be68adf481
Reviewed-on: https://chromium-review.googlesource.com/1757652
Tested-by: Wei-Cheng Xiao <garryxiao@chromium.org>
Commit-Ready: Wei-Cheng Xiao <garryxiao@chromium.org>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
diff --git a/client/site_tests/platform_EncryptedStateful/platform_EncryptedStateful.py b/client/site_tests/platform_EncryptedStateful/platform_EncryptedStateful.py
index 7c9a370..f7a337f 100644
--- a/client/site_tests/platform_EncryptedStateful/platform_EncryptedStateful.py
+++ b/client/site_tests/platform_EncryptedStateful/platform_EncryptedStateful.py
@@ -2,7 +2,7 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
-import logging, os, tempfile, shutil, stat, time, posix
+import logging, os, tempfile, shutil, stat, time
 from autotest_lib.client.bin import test, utils
 from autotest_lib.client.common_lib import error
 
@@ -259,7 +259,7 @@
         # Perform post-mount sanity checks (and handle unfinalized devices).
         encstate.check_sizes(finalized=os.path.exists(encstate.key))
 
-    def factory_key(self):
+    def encstateful_reclamation_check(self):
         # Create test root directory.
         encstate = EncryptedStateful()
 
@@ -269,11 +269,12 @@
         chk.check(not os.path.exists(encstate.block),
                   "%s does not exist" % (encstate.block))
 
-        # Mount a fresh encrypted stateful, with factory static key.
-        encstate.mount("factory")
+        # Mount a fresh encrypted stateful, following the default workflow to
+        # get the system key.
+        encstate.mount()
 
         # Perform post-mount sanity checks.
-        encstate.check_sizes()
+        encstate.check_sizes(finalized=os.path.exists(encstate.key))
 
         # Check disk reclamation for kernels that support PUNCH_HOLE.
         if self.is_punch_hole_supported():
@@ -307,6 +308,5 @@
         # Do a no-write, no-TPM test with sanity checks.
         self.no_tpm()
 
-        # There is no interactively controllable TPM mock yet for
-        # mount-encrypted, so we can only test the static key currently.
-        self.factory_key()
+        # Do a reclamation check against the encrypted stateful partition.
+        self.encstateful_reclamation_check()