Author: rvs
Date: Sat Mar 24 00:33:47 2012
New Revision: 1304685
URL: http://svn.apache.org/viewvc?rev=1304685&view=rev
Log:
BIGTOP-481. fix the way to handle repo key for Debian like system (Johnny Zhang
via rvs)
Modified:
incubator/bigtop/trunk/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/pmanager/AptCmdLinePackageManager.groovy
incubator/bigtop/trunk/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/pmanager/PackageManager.groovy
incubator/bigtop/trunk/bigtop-tests/test-artifacts/package/src/main/groovy/org/apache/bigtop/itest/packagesmoke/PackageTestRepoMgr.groovy
Modified:
incubator/bigtop/trunk/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/pmanager/AptCmdLinePackageManager.groovy
URL:
http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/pmanager/AptCmdLinePackageManager.groovy?rev=1304685&r1=1304684&r2=1304685&view=diff
==============================================================================
---
incubator/bigtop/trunk/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/pmanager/AptCmdLinePackageManager.groovy
(original)
+++
incubator/bigtop/trunk/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/pmanager/AptCmdLinePackageManager.groovy
Sat Mar 24 00:33:47 2012
@@ -29,6 +29,18 @@ class AptCmdLinePackageManager extends P
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;
Modified:
incubator/bigtop/trunk/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/pmanager/PackageManager.groovy
URL:
http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/pmanager/PackageManager.groovy?rev=1304685&r1=1304684&r2=1304685&view=diff
==============================================================================
---
incubator/bigtop/trunk/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/pmanager/PackageManager.groovy
(original)
+++
incubator/bigtop/trunk/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/pmanager/PackageManager.groovy
Sat Mar 24 00:33:47 2012
@@ -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
Modified:
incubator/bigtop/trunk/bigtop-tests/test-artifacts/package/src/main/groovy/org/apache/bigtop/itest/packagesmoke/PackageTestRepoMgr.groovy
URL:
http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-tests/test-artifacts/package/src/main/groovy/org/apache/bigtop/itest/packagesmoke/PackageTestRepoMgr.groovy?rev=1304685&r1=1304684&r2=1304685&view=diff
==============================================================================
---
incubator/bigtop/trunk/bigtop-tests/test-artifacts/package/src/main/groovy/org/apache/bigtop/itest/packagesmoke/PackageTestRepoMgr.groovy
(original)
+++
incubator/bigtop/trunk/bigtop-tests/test-artifacts/package/src/main/groovy/org/apache/bigtop/itest/packagesmoke/PackageTestRepoMgr.groovy
Sat Mar 24 00:33:47 2012
@@ -72,7 +72,7 @@ class PackageTestRepoMgr {
pm.cleanup();
try {
String repoText = cdhRepoFileURL.toURL().text;
- if (pm.addBinRepo(repoName, repoText)) {
+ if (pm.addBinRepo(repoName, repoText, cdhKeyURL)) {
return false;
}