From 724db8753b158cfa53ecf988ab5c4c6ba0ad915c Mon Sep 17 00:00:00 2001 From: Roman Shaposhnik Date: Sat, 24 Mar 2012 00:33:47 +0000 Subject: BIGTOP-481. fix the way to handle repo key for Debian like system (Johnny Zhang via rvs) git-svn-id: https://svn.apache.org/repos/asf/incubator/bigtop/trunk@1304685 13f79535-47bb-0310-9956-ffa450edef68 --- .../bigtop/itest/pmanager/AptCmdLinePackageManager.groovy | 12 ++++++++++++ .../org/apache/bigtop/itest/pmanager/PackageManager.groovy | 11 +++++++++++ 2 files changed, 23 insertions(+) (limited to 'bigtop-test-framework') diff --git a/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/pmanager/AptCmdLinePackageManager.groovy b/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/pmanager/AptCmdLinePackageManager.groovy index 15a802ff..0ab726c2 100644 --- a/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/pmanager/AptCmdLinePackageManager.groovy +++ b/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/pmanager/AptCmdLinePackageManager.groovy @@ -29,6 +29,18 @@ class AptCmdLinePackageManager extends PackageManager { shRoot.exec("debconf-set-selections <<__EOT__\n${defaults}\n__EOT__"); } + public int addBinRepo(String record, String url, String key) { + if (key) { + def text = key.toURL().text; + shRoot.exec("apt-key add - <<__EOT__\n${text}\n__EOT__"); + if (shRoot.getRet()) { + return shRoot.getRet(); + } + } else { + return addBinRepo(record, url); + } + } + public int addBinRepo(String record, String url, String key, String cookie) { if (!url) url = ROOT_URL; diff --git a/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/pmanager/PackageManager.groovy b/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/pmanager/PackageManager.groovy index 7a7086f5..b65c4c8c 100644 --- a/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/pmanager/PackageManager.groovy +++ b/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/pmanager/PackageManager.groovy @@ -41,6 +41,17 @@ public abstract class PackageManager { * @return int return code of the operation: o in case of success, non-zero otherwise */ abstract public int addBinRepo(String record, String url, String key, String cookie) + /** + * Register a binary package repository so that packages can be accessed from it. + * NOTE: repository management is assumed to follow a KVP API with unique implementation + * specific keys (records) referencing tuples of information describing a repository + * + * @param record a package manager specific KEY portion of the repository registration (null is default) + * @param url a URL containing the packages constituting the repository (null is default) + * @param key an optional (can be null) cryptographic key for authenticating the content of the repository + * @return int return code of the operation: o in case of success, non-zero otherwise + */ + abstract public int addBinRepo(String record, String url, String key) /** * Register a binary package repository so that packages can be accessed from it. * NOTE: repository management is assumed to follow a KVP API with unique implementation -- cgit v1.2.3