use of com.redhat.qe.tools.SSHCommandResult in project rhsm-qe by RedHatQE.
the class BugzillaTests method testCorruptIdentityCert.
/**
* @author skallesh
* @throws Exception
* @throws JSONException
*/
@// update=true, // uncomment to make TestDefinition changes update Polarion testcases through the polarize testcase importer
TestDefinition(projectID = { Project.RHEL6, Project.RedHatEnterpriseLinux7 }, testCaseID = { "RHEL6-21979", "RHEL7-51841" }, level = DefTypes.Level.COMPONENT, component = "subscription-manager", testtype = @TestType(testtype = DefTypes.TestTypes.FUNCTIONAL, subtype1 = DefTypes.Subtypes.RELIABILITY, subtype2 = DefTypes.Subtypes.EMPTY), posneg = PosNeg.NEGATIVE, importance = DefTypes.Importance.HIGH, automation = DefTypes.Automation.AUTOMATED, tags = "Tier3")
@Test(description = "verify if corrupt identity cert displays a trace back for list command", groups = { "Tier3Tests", "VerifyCorruptIdentityCert", "blockedByBug-607162" }, enabled = true)
public void testCorruptIdentityCert() throws JSONException, Exception {
clienttasks.register(sm_clientUsername, sm_clientPassword, sm_clientOrg, null, null, null, null, null, null, null, (String) null, null, null, null, true, null, null, null, null, null);
client.runCommandAndWait("cp /etc/pki/consumer/cert.pem /etc/pki/consumer/cert.pem.save");
RemoteFileTasks.runCommandAndAssert(client, "openssl x509 -noout -text -in " + clienttasks.consumerCertFile() + " > /tmp/stdout; mv /tmp/stdout -f " + clienttasks.consumerCertFile(), 0);
SSHCommandResult result = clienttasks.list_(null, true, null, null, null, null, null, null, null, null, null, null, null, null);
if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.20.1-1")) {
// commit 79f86e4c043ee751677131ed4e3cf00affd13087
Assert.assertEquals(result.getStderr().trim(), "Consumer identity either does not exist or is corrupted. Try register --help", "stdout");
} else if ((clienttasks.isPackageVersion("subscription-manager", ">=", "1.13.8-1"))) {
// post
// commit
// df95529a5edd0be456b3528b74344be283c4d258
Assert.assertEquals(result.getStderr().trim(), clienttasks.msg_ConsumerNotRegistered, "stderr");
} else {
Assert.assertEquals(result.getStdout().trim(), clienttasks.msg_ConsumerNotRegistered, "stdout");
}
}
use of com.redhat.qe.tools.SSHCommandResult in project rhsm-qe by RedHatQE.
the class BugzillaTests method testCacheAndFactsFilePermissions.
/*
* @author redakkan
*
* @throws exception
*
* @throws JSONException *
*/
@// update=true, // uncomment to make TestDefinition changes update Polarion testcases through the polarize testcase importer
TestDefinition(projectID = { Project.RedHatEnterpriseLinux7 }, testCaseID = { "RHEL7-55664" }, level = DefTypes.Level.COMPONENT, component = "subscription-manager", testtype = @TestType(testtype = DefTypes.TestTypes.FUNCTIONAL, subtype1 = DefTypes.Subtypes.RELIABILITY, subtype2 = DefTypes.Subtypes.EMPTY), posneg = PosNeg.POSITIVE, importance = DefTypes.Importance.HIGH, automation = DefTypes.Automation.AUTOMATED, tags = "Tier3")
@Test(description = "Verify the file permissions on /var/lib/rhsm/cache and facts files", groups = { "Tier3Tests", "blockedByBug-1297485", "blockedByBug-1297493", "blockedByBug-1340525", "blockedByBug-1389449" }, enabled = true)
public void testCacheAndFactsFilePermissions() throws JSONException, Exception {
if (clienttasks.isPackageVersion("subscription-manager", "<", "1.17.7-1")) {
// caches.
throw new SkipException("This test applies a newer version of subscription manager that includes fixes for bugs 1297493 and 1297485.");
}
String command = clienttasks.rhsmCacheDir;
// gets
SSHCommandResult result = client.runCommandAndWait("stat -c '%a' " + command);
// the File /var/lib/rhsm/cache access rights in octal
// post
Assert.assertEquals(result.getStdout().trim(), "750", "Expected permission on /var/lib/rhsm/cache is 750");
// commit
// 9dec31c377b57b4c98f845c018a5372d6f650d88
// gets
SSHCommandResult result1 = client.runCommandAndWait("stat -c '%a' /var/lib/rhsm/facts");
// the File /var/lib/rhsm/facts access rights in octal
// post
Assert.assertEquals(result1.getStdout().trim(), "750", "Expected permission on /var/lib/rhsm/facts is 750");
// commit
// 9dec31c377b57b4c98f845c018a5372d6f650d88
}
use of com.redhat.qe.tools.SSHCommandResult in project rhsm-qe by RedHatQE.
the class BugzillaTests method testFunctionalityAccessAfterUnregister.
/**
* @author skallesh
* @throws Exception
* @throws JSONException
*/
@// update=true, // uncomment to make TestDefinition changes update Polarion testcases through the polarize testcase importer
TestDefinition(projectID = { Project.RHEL6, Project.RedHatEnterpriseLinux7 }, testCaseID = { "RHEL6-21952", "RHEL7-51814" }, level = DefTypes.Level.COMPONENT, component = "subscription-manager", testtype = @TestType(testtype = DefTypes.TestTypes.FUNCTIONAL, subtype1 = DefTypes.Subtypes.RELIABILITY, subtype2 = DefTypes.Subtypes.EMPTY), posneg = PosNeg.POSITIVE, importance = DefTypes.Importance.HIGH, automation = DefTypes.Automation.AUTOMATED, tags = "Tier3")
@Test(description = "Verify Functionality Access After Unregister", groups = { "Tier3Tests", "VerifyFunctionalityAccessAfterUnregister" }, enabled = true)
@ImplementsNitrateTest(caseId = 50215)
public void testFunctionalityAccessAfterUnregister() throws JSONException, Exception {
clienttasks.register(sm_clientUsername, sm_clientPassword, sm_clientOrg);
String availList = clienttasks.listAllAvailableSubscriptionPools().getStdout();
Assert.assertNotNull(availList);
clienttasks.unregister(null, null, null, null);
SSHCommandResult listResult = clienttasks.list_(true, true, null, null, null, null, null, null, null, null, null, null, null, null);
String expected = "This system is not yet registered. Try 'subscription-manager register --help' for more information.";
if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.13.8-1")) {
// post
// commit
// df95529a5edd0be456b3528b74344be283c4d258
Assert.assertEquals(listResult.getStderr().trim(), expected, "stderr");
} else {
Assert.assertEquals(listResult.getStdout().trim(), expected, "stdout");
}
ConsumerCert consumercert = clienttasks.getCurrentConsumerCert();
Assert.assertNull(consumercert);
}
use of com.redhat.qe.tools.SSHCommandResult in project rhsm-qe by RedHatQE.
the class BugzillaTests method testServiceLevelWithOrgWithoutList.
/**
* @author skallesh
*/
@// update=true, // uncomment to make TestDefinition changes update Polarion testcases through the polarize testcase importer
TestDefinition(projectID = { Project.RHEL6, Project.RedHatEnterpriseLinux7 }, testCaseID = { "RHEL6-21926", "RHEL7-51787" }, level = DefTypes.Level.COMPONENT, component = "subscription-manager", testtype = @TestType(testtype = DefTypes.TestTypes.FUNCTIONAL, subtype1 = DefTypes.Subtypes.RELIABILITY, subtype2 = DefTypes.Subtypes.EMPTY), posneg = PosNeg.POSITIVE, importance = DefTypes.Importance.HIGH, automation = DefTypes.Automation.AUTOMATED, tags = "Tier3")
@Test(description = "subscription-manager: service-level --org (without --list option)", groups = { "Tier3Tests", "ServicelevelTest", "blockedByBug-826856" }, enabled = true)
public void testServiceLevelWithOrgWithoutList() {
SSHCommandResult result;
clienttasks.register(sm_clientUsername, sm_clientPassword, sm_clientOrg, null, null, null, null, null, null, null, (List<String>) null, null, null, null, true, null, null, null, null, null);
result = clienttasks.service_level_(null, false, null, null, sm_clientUsername, sm_clientPassword, "MyOrg", null, null, null, null, null, null);
if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.13.9-1")) {
// post
// commit
// a695ef2d1da882c5f851fde90a24f957b70a63ad
Assert.assertEquals(result.getStderr().trim(), "Error: --org is only supported with the --list option", "stderr");
} else {
Assert.assertEquals(result.getStdout().trim(), "Error: --org is only supported with the --list option", "stdout");
}
}
use of com.redhat.qe.tools.SSHCommandResult in project rhsm-qe by RedHatQE.
the class BugzillaTests method testAttemptRegisterWithWhiteSpacesInUsername.
/**
* @author skallesh
*/
@// update=true, // uncomment to make TestDefinition changes update Polarion testcases through the polarize testcase importer
TestDefinition(projectID = { Project.RHEL6, Project.RedHatEnterpriseLinux7 }, testCaseID = { "RHEL6-21900", "RHEL7-51761" }, level = DefTypes.Level.COMPONENT, component = "subscription-manager", testtype = @TestType(testtype = DefTypes.TestTypes.FUNCTIONAL, subtype1 = DefTypes.Subtypes.RELIABILITY, subtype2 = DefTypes.Subtypes.EMPTY), posneg = PosNeg.NEGATIVE, importance = DefTypes.Importance.HIGH, automation = DefTypes.Automation.AUTOMATED, tags = "Tier3")
@Test(description = "subscription-manager: attempt register to with white space in the user name should fail", groups = { "Tier3Tests", "registeredTests", "blockedByBug-719378" }, enabled = true)
public void testAttemptRegisterWithWhiteSpacesInUsername() {
SSHCommandResult result = clienttasks.register_("user name", "password", sm_clientOrg, null, null, null, null, null, null, null, (String) null, null, null, null, true, null, null, null, null, null);
Assert.assertEquals(result.getStderr().trim(), servertasks.invalidCredentialsMsg(), "The expected stdout result when attempting to register with a username containing whitespace.");
}
Aggregations