Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Unified Diff: client/site_tests/security_BundledCRXs/security_BundledCRXs.py

Issue 6606023: Remove security_BundledCRXs test. Superceded by security_BundledCRXPermissions rewrite. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/site_tests/security_BundledCRXs/control ('k') | server/site_tests/suites/control.security » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/site_tests/security_BundledCRXs/security_BundledCRXs.py
diff --git a/client/site_tests/security_BundledCRXs/security_BundledCRXs.py b/client/site_tests/security_BundledCRXs/security_BundledCRXs.py
deleted file mode 100644
index 0a8fb961c8c156d821ca81d93f47ef02e85250ed..0000000000000000000000000000000000000000
--- a/client/site_tests/security_BundledCRXs/security_BundledCRXs.py
+++ /dev/null
@@ -1,63 +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
-import os
-
-from autotest_lib.client.bin import test, utils
-from autotest_lib.client.common_lib import error
-
-class security_BundledCRXs(test.test):
- version = 1
- _CRX_DIR = '/opt/google/chrome/extensions/'
-
-
- def load_baseline(self):
- """
- Return a list of crx's we expect, e.g.
- ['aciahcmjmecflokailenpkdchphgkefd.crx',
- 'blpcfgokakmgnkcojhhkbfbldkacnbeo.crx', ...]
- """
- # Figure out path to baseline file, by looking up our own path
- bpath = os.path.abspath(__file__)
- bpath = os.path.join(os.path.dirname(bpath), 'baseline')
- bfile = open(bpath)
- baseline_data = bfile.read()
- baseline_set = set(baseline_data.splitlines())
- bfile.close()
- return baseline_set
-
-
- def fetch_bundled_crxs(self):
- """
- Return a list of crx's found bundled on the system.
- (The data returned is comparable to that of load_baseline().)
- """
- cmd = "find '%s' -xdev -name '*.crx' -printf '%%f\\n'"
- return set(utils.system_output(cmd % self._CRX_DIR).splitlines())
-
-
- def run_once(self):
- """
- Enumerate all the bundled CRXs.
- Fail if it does not match the expected set.
- """
- observed_set = self.fetch_bundled_crxs()
- baseline_set = self.load_baseline()
-
- # If something in the observed set is not
- # covered by the baseline...
- diff = observed_set.difference(baseline_set)
- if len(diff) > 0:
- for crx in diff:
- logging.error('New/unexpected bundled crx %s' % crx)
-
- # Or, things in baseline are missing from the system:
- diff2 = baseline_set.difference(observed_set)
- if len(diff2) > 0:
- for crx in diff2:
- logging.error('Missing bundled crx %s' % crx)
-
- if (len(diff) + len(diff2)) > 0:
- raise error.TestFail('Baseline mismatch')
« no previous file with comments | « client/site_tests/security_BundledCRXs/control ('k') | server/site_tests/suites/control.security » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698