login: Remove login_OwnershipApi.

The test is ported to Tast session.OwnershipAPI.
Remove the autotest.

BUG=chromium:899758
TEST=Ran pre-CQ.

Cq-Depend: chromium:1768310
Change-Id: I346b7a2a4872c935a7b1911f4fcbba4c0c6d7127
Reviewed-on: https://chromium-review.googlesource.com/1768312
Tested-by: Hidehiko Abe <hidehiko@chromium.org>
Commit-Ready: Hidehiko Abe <hidehiko@chromium.org>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Lutz Justen <ljusten@chromium.org>
Reviewed-by: Mattias Nissler <mnissler@chromium.org>
diff --git a/client/site_tests/login_OwnershipApi/control b/client/site_tests/login_OwnershipApi/control
deleted file mode 100644
index 1547897..0000000
--- a/client/site_tests/login_OwnershipApi/control
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-AUTHOR = "cmasone, mnissler"
-NAME = "login_OwnershipApi"
-ATTRIBUTES = "suite:bvt-inline, suite:smoke"
-TIME="SHORT"
-TEST_CLASS = "login"
-TEST_CATEGORY = "Functional"
-TEST_TYPE = "client"
-JOB_RETRIES = 2
-
-DOC = """
-Tests to ensure that the Ownership API works for a local device owner.
-"""
-
-job.run_test("login_OwnershipApi")
diff --git a/client/site_tests/login_OwnershipApi/login_OwnershipApi.py b/client/site_tests/login_OwnershipApi/login_OwnershipApi.py
deleted file mode 100644
index 5de2862..0000000
--- a/client/site_tests/login_OwnershipApi/login_OwnershipApi.py
+++ /dev/null
@@ -1,92 +0,0 @@
-# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import logging, tempfile
-from dbus.mainloop.glib import DBusGMainLoop
-
-from autotest_lib.client.bin import test
-from autotest_lib.client.common_lib import autotemp, error
-from autotest_lib.client.common_lib.cros import policy, session_manager
-from autotest_lib.client.cros import cros_ui, cryptohome, ownership
-
-
-class login_OwnershipApi(test.test):
-    """Tests to ensure that the Ownership API works for a local device owner.
-    """
-    version = 1
-
-    _tempdir = None
-
-
-    def initialize(self):
-        super(login_OwnershipApi, self).initialize()
-        policy.install_protobufs(self.autodir, self.job)
-        self._bus_loop = DBusGMainLoop(set_as_default=True)
-
-        # Clear existing ownership and inject known keys.
-        cros_ui.stop()
-        ownership.clear_ownership_files_no_restart()
-
-        # Make device already owned by ownership.TESTUSER.
-        cryptohome.mount_vault(ownership.TESTUSER,
-                               ownership.TESTPASS,
-                               create=True)
-        ownership.use_known_ownerkeys(ownership.TESTUSER)
-
-        self._tempdir = autotemp.tempdir(unique_id=self.__class__.__name__)
-        cros_ui.start()
-
-
-    def __generate_temp_filename(self, dir):
-        """Generate a guaranteed-unique filename in dir."""
-        just_for_name = tempfile.NamedTemporaryFile(dir=dir, delete=True)
-        basename = just_for_name.name
-        just_for_name.close()  # deletes file.
-        return basename
-
-
-    def run_once(self):
-        pkey = ownership.known_privkey()
-        pubkey = ownership.known_pubkey()
-        sm = session_manager.connect(self._bus_loop)
-        sm.StartSession(ownership.TESTUSER, '')
-
-        poldata = policy.build_policy_data(owner=ownership.TESTUSER,
-                                           guests=False,
-                                           new_users=True,
-                                           roaming=True,
-                                           whitelist=(ownership.TESTUSER,
-                                                      'a@b.c'))
-
-        policy_string = policy.generate_policy(pkey, pubkey, poldata)
-        policy.push_policy_and_verify(policy_string, sm)
-        retrieved_policy = policy.get_policy(sm)
-        if retrieved_policy is None: raise error.TestFail('Policy not found')
-        policy.compare_policy_response(retrieved_policy,
-                                       owner=ownership.TESTUSER,
-                                       guests=False,
-                                       new_users=True,
-                                       roaming=True,
-                                       whitelist=(ownership.TESTUSER, 'a@b.c'))
-        try:
-            # Sanity check against an incorrect policy
-            policy.compare_policy_response(retrieved_policy,
-                                           owner=ownership.TESTUSER,
-                                           guests=True,
-                                           whitelist=(ownership.TESTUSER,
-                                                      'a@b.c'))
-        except ownership.OwnershipError:
-            pass
-        else:
-            raise error.TestFail('Did not detect bad policy')
-
-
-    def cleanup(self):
-        if self._tempdir: self._tempdir.clean()
-        # Best effort to bounce the UI, which may be up or down.
-        cros_ui.stop(allow_fail=True)
-        cryptohome.unmount_vault(ownership.TESTUSER)
-        cryptohome.remove_vault(ownership.TESTUSER)
-        cros_ui.start(allow_fail=True, wait_for_login_prompt=False)
-        super(login_OwnershipApi, self).cleanup()