aboutsummaryrefslogtreecommitdiff
path: root/bigtop-test-framework/src/test/groovy/org/apache/bigtop/itest/pmanager/PackageManagerTest.groovy
diff options
context:
space:
mode:
Diffstat (limited to 'bigtop-test-framework/src/test/groovy/org/apache/bigtop/itest/pmanager/PackageManagerTest.groovy')
-rw-r--r--bigtop-test-framework/src/test/groovy/org/apache/bigtop/itest/pmanager/PackageManagerTest.groovy34
1 files changed, 22 insertions, 12 deletions
diff --git a/bigtop-test-framework/src/test/groovy/org/apache/bigtop/itest/pmanager/PackageManagerTest.groovy b/bigtop-test-framework/src/test/groovy/org/apache/bigtop/itest/pmanager/PackageManagerTest.groovy
index c0261d86..bb8f6d72 100644
--- a/bigtop-test-framework/src/test/groovy/org/apache/bigtop/itest/pmanager/PackageManagerTest.groovy
+++ b/bigtop-test-framework/src/test/groovy/org/apache/bigtop/itest/pmanager/PackageManagerTest.groovy
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -18,23 +18,34 @@
package org.apache.bigtop.itest.pmanager
+import org.apache.bigtop.itest.shell.OS
import org.junit.Test
import org.junit.Ignore
import static org.junit.Assert.assertTrue
import static org.junit.Assert.assertEquals
import static org.junit.Assert.assertFalse
-import static org.apache.bigtop.itest.pmanager.PackageManager.getPackageManager
import org.apache.bigtop.itest.posix.Service
+import static org.apache.bigtop.itest.pmanager.PackageManager.getPackageManager
class PackageManagerTest {
PackageManager pmgr = getPackageManager("")
+ private final String CRON_RPM
+
+ {
+ switch (OS.linux_flavor) {
+ case ~/(?is).*(redhat|centos|rhel|fedora|enterpriseenterpriseserver).*/:
+ CRON_RPM = "cronie"
+ break
+ default:
+ CRON_RPM = "cron"
+ }
+ }
@Test
void searchForGcc() {
List<PackageInstance> pkgs = pmgr.search("gcc")
- assertFalse("gcc non found in repository", pkgs.size() == 0)
- assertEquals("package name searched for differs from the result", "gcc", pkgs.get(0).name)
+ assertFalse("gcc not found in repository", pkgs.findAll({return it.name =~ /^gcc.*/}).size() == 0)
}
@Test
@@ -42,7 +53,7 @@ class PackageManagerTest {
List<PackageInstance> pkgs = pmgr.lookup("gcc");
assertFalse("gcc non found in repository", pkgs.size() == 0);
- assertFalse("can not get description for the gcc package", pkgs.get(0).getMeta()["description"].length() == 0);
+ assertFalse("can not get size for the gcc package", pkgs.get(0).getMeta()["size"]?.size() == 0);
}
@Ignore("required sudo")
@@ -62,7 +73,7 @@ class PackageManagerTest {
@Test
void testGetServicesCron() {
- PackageInstance cron = PackageInstance.getPackageInstance(pmgr, "cron")
+ PackageInstance cron = PackageInstance.getPackageInstance(pmgr, CRON_RPM)
Map<String, Service> svcs = pmgr.getServices(cron)
assertTrue("cron package is expected to provide at least one service", svcs.size() != 0)
@@ -70,7 +81,7 @@ class PackageManagerTest {
@Test
void testGetContentList() {
- PackageInstance cron = PackageInstance.getPackageInstance(pmgr, "cron");
+ PackageInstance cron = PackageInstance.getPackageInstance(pmgr, CRON_RPM);
List<String> list = pmgr.getContentList(cron);
list.each { println it};
@@ -79,7 +90,7 @@ class PackageManagerTest {
@Test
void testGetDocs() {
- PackageInstance cron = PackageInstance.getPackageInstance(pmgr, "cron");
+ PackageInstance cron = PackageInstance.getPackageInstance(pmgr, CRON_RPM);
List<String> list = pmgr.getDocs(cron);
list.each { println it};
@@ -96,10 +107,9 @@ class PackageManagerTest {
deps.size() > 0);
}
-
@Test
void testGetConfigs() {
- PackageInstance cron = PackageInstance.getPackageInstance(pmgr, "cron");
+ PackageInstance cron = PackageInstance.getPackageInstance(pmgr, CRON_RPM);
List<String> list = pmgr.getConfigs(cron);
list.each { println it};