aboutsummaryrefslogtreecommitdiff
path: root/bigtop-test-framework
diff options
context:
space:
mode:
authorRoman Shaposhnik <rvs@apache.org>2012-03-24 00:33:47 +0000
committerRoman Shaposhnik <rvs@apache.org>2012-03-24 00:33:47 +0000
commit724db8753b158cfa53ecf988ab5c4c6ba0ad915c (patch)
tree0c8e36c674029778a4986cf53013620e6b9fc153 /bigtop-test-framework
parentde84122b280a1ad909d87335bed2877996a1e7ac (diff)
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
Diffstat (limited to 'bigtop-test-framework')
-rw-r--r--bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/pmanager/AptCmdLinePackageManager.groovy12
-rw-r--r--bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/pmanager/PackageManager.groovy11
2 files changed, 23 insertions, 0 deletions
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
@@ -42,6 +42,17 @@ public abstract class PackageManager {
*/
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
* specific keys (records) referencing tuples of information describing a repository