Merge "conman:  Don't export TRYING_OPEN status at startup."
diff --git a/conman/connection_manager.py b/conman/connection_manager.py
index 1793263..11da31c 100755
--- a/conman/connection_manager.py
+++ b/conman/connection_manager.py
@@ -944,7 +944,7 @@
   def start_provisioning(self, wifi):
     wifi.set_gateway_ip(None)
     wifi.set_subnet(None)
-    wifi.provisioning_ratchet.reset()
+    wifi.provisioning_ratchet.start()
 
   def provisioning_failed(self, wifi):
     try:
diff --git a/conman/connection_manager_test.py b/conman/connection_manager_test.py
index 9b806f9..d7d0a40 100755
--- a/conman/connection_manager_test.py
+++ b/conman/connection_manager_test.py
@@ -676,6 +676,9 @@
   # correct; more thorough tests are in bridge_test in interface_test.py.
   acs_autoprov_filepath = os.path.join(c._tmp_dir, 'acs_autoprovisioning')
 
+  # Each Wifi's provisioning ratchet has beeen created, but not started.
+  wvtest.WVFAIL(c.has_status_files([status.P.TRYING_OPEN]))
+
   # Initially, there is ethernet access (via explicit check of ethernet status,
   # rather than the interface status file).
   wvtest.WVPASS(c.acs())
diff --git a/conman/ratchet.py b/conman/ratchet.py
index 7873c39..350ed47 100644
--- a/conman/ratchet.py
+++ b/conman/ratchet.py
@@ -140,9 +140,12 @@
     for step in self.steps:
       step.reset()
       self._set_step_status(step, False)
-    self._set_current_step_status(True)
     super(Ratchet, self).reset()
 
+  def start(self):
+    self.reset()
+    self._set_current_step_status(True)
+
   # Override check rather than evaluate because we don't want the Ratchet to
   # time out unless one of its steps does.
   def check(self):
diff --git a/conman/ratchet_test.py b/conman/ratchet_test.py
index 10c10ab..97f7c94 100755
--- a/conman/ratchet_test.py
+++ b/conman/ratchet_test.py
@@ -103,6 +103,10 @@
     # Test that timeouts are not just summed, but start whenever the previous
     # step completed.
     wvtest.WVPASSEQ(r._current_step, 0)  # pylint: disable=protected-access
+    wvtest.WVFAIL(os.path.isfile(os.path.join(status_export_path, 'X')))
+    wvtest.WVFAIL(os.path.isfile(os.path.join(status_export_path, 'Y')))
+    wvtest.WVFAIL(os.path.isfile(os.path.join(status_export_path, 'Z')))
+    r.start()
     wvtest.WVPASS(os.path.isfile(os.path.join(status_export_path, 'X')))
     wvtest.WVFAIL(os.path.isfile(os.path.join(status_export_path, 'Y')))
     wvtest.WVFAIL(os.path.isfile(os.path.join(status_export_path, 'Z')))