use of com.redhat.qe.auto.tcms.ImplementsNitrateTest in project rhsm-qe by RedHatQE.
the class BugzillaTests method testConfigSetServerPortValueToBlank.
/**
* @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-21904", "RHEL7-51765" }, 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 config Server port with blank or incorrect text produces traceback", groups = { "Tier3Tests", "configBlankTest", "blockedByBug-744654" }, enabled = true)
public // @ImplementsNitrateTest(caseId=)
void testConfigSetServerPortValueToBlank() {
List<String[]> listOfSectionNameValues = new ArrayList<String[]>();
String section = "server";
String name = "port";
String newValue = clienttasks.getConfFileParameter(clienttasks.rhsmConfFile, section, name);
listOfSectionNameValues.add(new String[] { section, name.toLowerCase(), "" });
SSHCommandResult results = clienttasks.config(null, null, true, listOfSectionNameValues);
String value = clienttasks.getConfFileParameter(clienttasks.rhsmConfFile, section, name);
Assert.assertEquals("", results.getStdout().trim());
listOfSectionNameValues.add(new String[] { section, name.toLowerCase(), newValue });
clienttasks.config(null, null, true, listOfSectionNameValues);
value = clienttasks.getConfFileParameter(clienttasks.rhsmConfFile, section, name);
Assert.assertEquals(value, newValue);
}
use of com.redhat.qe.auto.tcms.ImplementsNitrateTest in project rhsm-qe by RedHatQE.
the class BugzillaTests method testSubscribingToBogusPoolID.
/**
* @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-21973", "RHEL7-51835" }, 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 entitlement certs are downloaded if subscribed using bogus poolid", groups = { "Tier3Tests", "VerifySubscribingTobogusPoolID" }, enabled = true)
@ImplementsNitrateTest(caseId = 50223)
public void testSubscribingToBogusPoolID() throws JSONException, Exception {
String poolId = null;
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);
List<String[]> listOfSectionNameValues = new ArrayList<String[]>();
listOfSectionNameValues.add(new String[] { "rhsmcertd", "autoAttachInterval".toLowerCase(), "1440" });
clienttasks.config(null, null, true, listOfSectionNameValues);
clienttasks.unsubscribe(true, (BigInteger) null, null, null, null, null, null);
for (SubscriptionPool availList : clienttasks.getCurrentlyAvailableSubscriptionPools()) {
poolId = availList.poolId;
}
String pool = randomizeCaseOfCharactersInString(poolId);
clienttasks.subscribe_(null, null, pool, null, null, null, null, null, null, null, null, null, null);
List<File> Cert = clienttasks.getCurrentEntitlementCertFiles();
Assert.assertEquals(Cert.size(), 0);
}
use of com.redhat.qe.auto.tcms.ImplementsNitrateTest in project rhsm-qe by RedHatQE.
the class EventTests method testNegativeSuperUserPassword.
@// update=true // uncomment to make TestDefinition changes update Polarion testcases through the polarize testcase importer
TestDefinition(projectID = { Project.RHEL6, Project.RedHatEnterpriseLinux7 }, testCaseID = { "RHEL6-21841", "RHEL7-51662" }, 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: events: negative test for super user/password.", groups = { "Tier3Tests", "NegativeSuperUserPassword_Test" }, dependsOnGroups = {}, enabled = true, alwaysRun = true)
@ImplementsNitrateTest(caseId = 50404)
public void testNegativeSuperUserPassword() throws IllegalArgumentException, IOException, FeedException {
if (sm_serverAdminUsername.equals("") || sm_serverAdminPassword.equals(""))
throw new SkipException("This test requires the candlepin server admin username and password credentials.");
String authuser = "", authpwd = "";
try {
// enter the wrong user, correct passwd
authuser = sm_serverAdminUsername + getRandInt();
authpwd = sm_serverAdminPassword;
CandlepinTasks.getSyndFeed(authuser, authpwd, sm_serverUrl);
Assert.fail("Expected the candlepin server request for a syndication feed to return an HTTP response code 401 Unauthorized due to invalid authorization credentials " + authuser + ":" + authpwd);
} catch (IOException e) {
Assert.assertContainsMatch(e.getMessage(), "HTTP response code: 401", "Atom feed is unauthorized when attempting to authorize with credentials " + authuser + ":" + authpwd);
}
try {
// enter the correct user, wrong passwd
authuser = sm_serverAdminUsername;
authpwd = sm_serverAdminPassword + getRandInt();
CandlepinTasks.getSyndFeed(authuser, authpwd, sm_serverUrl);
Assert.fail("Expected the candlepin server request for a syndication feed to return an HTTP response code 401 Unauthorized due to invalid authorization credentials " + authuser + ":" + authpwd);
} catch (IOException e) {
Assert.assertContainsMatch(e.getMessage(), "HTTP response code: 401", "Atom feed is unauthorized when attempting to authorize with credentials " + authuser + ":" + authpwd);
}
// finally assert success with valid credentials
authuser = sm_serverAdminUsername;
authpwd = sm_serverAdminPassword;
SyndFeed feed = CandlepinTasks.getSyndFeed(authuser, authpwd, sm_serverUrl);
Assert.assertTrue(!feed.getEntries().isEmpty(), "Atom feed for all events is successful with valid credentials " + authuser + ":" + authpwd);
}
use of com.redhat.qe.auto.tcms.ImplementsNitrateTest in project rhsm-qe by RedHatQE.
the class FactsTests method testFactsListWhenNotRegistered.
@// update=true // uncomment to make TestDefinition changes update Polarion testcases through the polarize testcase importer
TestDefinition(projectID = { Project.RHEL6, Project.RedHatEnterpriseLinux7 }, testCaseID = { "RHEL6-36612", "RHEL7-51422" }, 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 = "Tier2")
@Test(description = "subscription-manager: facts --list (when not registered)", groups = { "Tier2Tests", "blockedByBug-654429", "blockedByBug-661329", "blockedByBug-666544" }, enabled = true)
public // @ImplementsNitrateTest(caseId=)
void testFactsListWhenNotRegistered() {
// make sure we are not registered
clienttasks.unregister(null, null, null, null);
log.info("Assert that one need not be registered to list the facts...");
SSHCommandResult result = clienttasks.facts(true, false, null, null, null, null);
Assert.assertContainsNoMatch(result.getStderr(), clienttasks.msg_ConsumerNotRegistered, "One need not be registered to list the facts.");
Assert.assertContainsNoMatch(result.getStdout(), clienttasks.msg_ConsumerNotRegistered, "One need not be registered to list the facts.");
}
use of com.redhat.qe.auto.tcms.ImplementsNitrateTest in project rhsm-qe by RedHatQE.
the class FactsTests method testProcCpuInfoCollection.
@// update=true // uncomment to make TestDefinition changes update Polarion testcases through the polarize testcase importer
TestDefinition(projectID = { Project.RHEL6, Project.RedHatEnterpriseLinux7 }, testCaseID = { "RHEL6-22221", "RHEL7-51427" }, 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 = "Tier1")
@Test(description = "Verify proc_cpuinfo facts are now collected on subscription-manager-1.16.8-2+. On ppc64 systems, also verify that a virt.uuid is collected on a pSeries platform.", groups = { "Tier1Tests", "blockedByBug-1300805", "blockedByBug-1300816" }, enabled = true)
public // @ImplementsNitrateTest(caseId=)
void testProcCpuInfoCollection() {
if (clienttasks.isPackageVersion("subscription-manager", "<", "1.16.8-2")) {
// subscription-manager commit f8416137a3b426aa54608116e005df7273abfada 1300805: Add support for ppc64 virt.uuid
throw new SkipException("Collection of proc_cpuinfo facts was not available in this version of subscription-manager '" + clienttasks.installedPackageVersionMap.get("subscription-manager") + "'.");
}
// log info about virt-what
client.runCommandAndWait("rpm -q virt-what");
SSHCommandResult virtWhatResult = client.runCommandAndWait("virt-what");
// this is the list of base facts in English
Map<String, String> procCpuInfoFacts = clienttasks.getFacts("proc_cpuinfo.common");
// assert proc_cpuinfo.common facts are now collected on x86_64/ppc64/ppc64le/aarch64
ArrayList<String> procCpuInfoArches = new ArrayList<String>(Arrays.asList("x86_64", "ppc64", "ppc64le", "aarch64"));
if (procCpuInfoArches.contains(clienttasks.arch)) {
Assert.assertTrue(!procCpuInfoFacts.isEmpty(), "proc_cpuinfo.common facts are now collected on '" + clienttasks.arch + "'.");
} else {
Assert.assertTrue(procCpuInfoFacts.isEmpty(), "Not expecting proc_cpuinfo.common facts to be collected on '" + clienttasks.arch + "'. (Current list of expected arches is " + procCpuInfoArches + ")");
}
// assert specific proc_cpuinfo.common facts are now collected on ppc64*
if (clienttasks.arch.startsWith("ppc64")) {
for (String fact : new String[] { "proc_cpuinfo.common.machine", "proc_cpuinfo.common.model", "proc_cpuinfo.common.platform" }) {
Assert.assertNotNull(procCpuInfoFacts.get(fact), "Expected fact '" + fact + "' was collected on '" + clienttasks.arch + "'.");
}
// HAVING SECOND THOUGTS ON THE VALIDITY OF THIS ASSERTION BLOCK
if (false) {
// assert that virt.uuid is set on a pSeries ppc64 System
if (procCpuInfoFacts.get("proc_cpuinfo.common.platform").toLowerCase().contains("pSeries".toLowerCase())) {
String virtUuid = clienttasks.getFactValue("virt.uuid");
Assert.assertNotNull(virtUuid, "The virt.uuid fact is set on a pSeries '" + clienttasks.arch + "' platform.");
// assert virt.uuid not Unknown
// TEMPORARY WORKAROUND FOR BUG
// Bug 1310846 - The virt.uuid fact value 'Unknown' is not Unknown on a pSeries 'ppc64' platform. expected:<true> but was:<false>
String bugId = "1310846";
// Bug 1310846 - The virt.uuid fact value 'Unknown' is not Unknown on a pSeries 'ppc64' platform. expected:<true> but was:<false>
boolean invokeWorkaroundWhileBugIsOpen = true;
try {
if (invokeWorkaroundWhileBugIsOpen && BzChecker.getInstance().isBugOpen(bugId)) {
log.fine("Invoking workaround for " + BzChecker.getInstance().getBugState(bugId).toString() + " Bugzilla " + bugId + ". (https://bugzilla.redhat.com/show_bug.cgi?id=" + bugId + ")");
SubscriptionManagerCLITestScript.addInvokedWorkaround(bugId);
} else {
invokeWorkaroundWhileBugIsOpen = false;
}
} catch (BugzillaAPIException be) {
/* ignore exception */
} catch (RuntimeException re) {
/* ignore exception */
}
if (invokeWorkaroundWhileBugIsOpen) {
log.warning("Skipping the assertion of fact virt.uuid is not Unknown on a '" + clienttasks.arch + "' '" + procCpuInfoFacts.get("proc_cpuinfo.common.platform") + "' platform.");
} else
// END OF WORKAROUND
Assert.assertTrue(!virtUuid.toLowerCase().equalsIgnoreCase("Unknown"), "The virt.uuid fact value '" + virtUuid + "' is not Unknown on a pSeries '" + clienttasks.arch + "' platform. ");
// assert virt.is_guest is True
// TEMPORARY WORKAROUND FOR BUG
/*String*/
// Bug 1072524 - Add support for detecting ppc64 LPAR as virt guests
bugId = "1072524";
// Bug 1072524 - Add support for detecting ppc64 LPAR as virt guests
invokeWorkaroundWhileBugIsOpen = true;
/*boolean*/
try {
if (invokeWorkaroundWhileBugIsOpen && BzChecker.getInstance().isBugOpen(bugId)) {
log.fine("Invoking workaround for " + BzChecker.getInstance().getBugState(bugId).toString() + " Bugzilla " + bugId + ". (https://bugzilla.redhat.com/show_bug.cgi?id=" + bugId + ")");
SubscriptionManagerCLITestScript.addInvokedWorkaround(bugId);
} else {
invokeWorkaroundWhileBugIsOpen = false;
}
} catch (BugzillaAPIException be) {
/* ignore exception */
} catch (RuntimeException re) {
/* ignore exception */
}
if (invokeWorkaroundWhileBugIsOpen) {
log.warning("Skipping the assertion of fact virt.is_guest:True on a '" + clienttasks.arch + "' '" + procCpuInfoFacts.get("proc_cpuinfo.common.platform") + "' platform.");
} else
// END OF WORKAROUND
Assert.assertTrue(Boolean.valueOf(clienttasks.getFactValue("virt.is_guest")), "The virt.is_guest fact value is true on a pSeries '" + clienttasks.arch + "' platform. ");
}
}
// I THINK THE FOLLOWING IS BETTER
// assert that virt.uuid is populated when /proc/device-tree/vm,uuid is known // Bug 1300805 - ppc64 kvm guests do not collect a virt.uuid fact.
String procDeviceTreeVmUuidFile = "/proc/device-tree/vm,uuid";
Boolean virtIsGuest = Boolean.valueOf(clienttasks.getFactValue("virt.is_guest"));
String virtUuid = clienttasks.getFactValue("virt.uuid");
if (RemoteFileTasks.testExists(client, procDeviceTreeVmUuidFile)) {
String expectedVirtUuid = client.runCommandAndWait("cat " + procDeviceTreeVmUuidFile).getStdout().trim();
if (virtWhatResult.getStdout().isEmpty()) {
// when virt-what reports nothing, then this system is physical!
Assert.assertNull(virtUuid, "The virt.uuid fact is NOT set on a '" + clienttasks.arch + "' platform when virt-what reports nothing despite the fact that " + procDeviceTreeVmUuidFile + " is defined.");
} else {
Assert.assertNotNull(virtUuid, "The virt.uuid fact is set on a '" + clienttasks.arch + "' platform when " + procDeviceTreeVmUuidFile + " is defined.");
Assert.assertEquals(virtUuid, expectedVirtUuid, "The virt.uuid fact on a '" + clienttasks.arch + "' '" + procCpuInfoFacts.get("proc_cpuinfo.common.model") + "' '" + procCpuInfoFacts.get("proc_cpuinfo.common.platform") + "' platform should match the contents of " + procDeviceTreeVmUuidFile);
}
// assert virt.is_guest is True
// // TEMPORARY WORKAROUND FOR BUG
// // Bug 1072524 has been VERIFIED
// String bugId = "1072524"; boolean invokeWorkaroundWhileBugIsOpen = true; // Bug 1072524 - Add support for detecting ppc64 LPAR as virt guests
// try {if (invokeWorkaroundWhileBugIsOpen&&BzChecker.getInstance().isBugOpen(bugId)) {log.fine("Invoking workaround for "+BzChecker.getInstance().getBugState(bugId).toString()+" Bugzilla "+bugId+". (https://bugzilla.redhat.com/show_bug.cgi?id="+bugId+")");SubscriptionManagerCLITestScript.addInvokedWorkaround(bugId);} else {invokeWorkaroundWhileBugIsOpen=false;}} catch (BugzillaAPIException be) {/* ignore exception */} catch (RuntimeException re) {/* ignore exception */}
// if (invokeWorkaroundWhileBugIsOpen) {
// log.warning("Skipping the assertion for fact virt.is_guest:True on a '"+clienttasks.arch+"' '"+procCpuInfoFacts.get("proc_cpuinfo.common.model")+"' '"+procCpuInfoFacts.get("proc_cpuinfo.common.platform")+"' platform.");
// } else
// // END OF WORKAROUND
// TEMPORARY WORKAROUND FOR BUG
// Bug 1372108 - facts related to the identification of a virtual/physical system on ppc64/ppc64le are conflicting
String bugId = "1372108";
// Bug 1372108 - facts related to the identification of a virtual/physical system on ppc64/ppc64le are conflicting
boolean invokeWorkaroundWhileBugIsOpen = true;
try {
if (invokeWorkaroundWhileBugIsOpen && BzChecker.getInstance().isBugOpen(bugId)) {
log.fine("Invoking workaround for " + BzChecker.getInstance().getBugState(bugId).toString() + " Bugzilla " + bugId + ". (https://bugzilla.redhat.com/show_bug.cgi?id=" + bugId + ")");
SubscriptionManagerCLITestScript.addInvokedWorkaround(bugId);
} else {
invokeWorkaroundWhileBugIsOpen = false;
}
} catch (BugzillaAPIException be) {
/* ignore exception */
} catch (RuntimeException re) {
/* ignore exception */
}
if (virtIsGuest == false && invokeWorkaroundWhileBugIsOpen) {
log.warning("Skipping the assertion for fact virt.is_guest:True on a '" + clienttasks.arch + "' '" + procCpuInfoFacts.get("proc_cpuinfo.common.model") + "' '" + procCpuInfoFacts.get("proc_cpuinfo.common.platform") + "' platform.");
} else
// END OF WORKAROUND
Assert.assertTrue(virtIsGuest, "The virt.is_guest fact value is true on a '" + clienttasks.arch + "' '" + procCpuInfoFacts.get("proc_cpuinfo.common.model") + "' '" + procCpuInfoFacts.get("proc_cpuinfo.common.platform") + "' platform because file '" + procDeviceTreeVmUuidFile + "' exists.");
} else {
// TEMPORARY WORKAROUND FOR BUG
// Bug 1372108 - facts related to the identification of a virtual/physical system on ppc64/ppc64le are conflicting
String bugId = "1372108";
// Bug 1372108 - facts related to the identification of a virtual/physical system on ppc64/ppc64le are conflicting
boolean invokeWorkaroundWhileBugIsOpen = true;
try {
if (invokeWorkaroundWhileBugIsOpen && BzChecker.getInstance().isBugOpen(bugId)) {
log.fine("Invoking workaround for " + BzChecker.getInstance().getBugState(bugId).toString() + " Bugzilla " + bugId + ". (https://bugzilla.redhat.com/show_bug.cgi?id=" + bugId + ")");
SubscriptionManagerCLITestScript.addInvokedWorkaround(bugId);
} else {
invokeWorkaroundWhileBugIsOpen = false;
}
} catch (BugzillaAPIException be) {
/* ignore exception */
} catch (RuntimeException re) {
/* ignore exception */
}
if (virtIsGuest == true && invokeWorkaroundWhileBugIsOpen) {
log.warning("Skipping the assertion for fact virt.is_guest:False on a '" + clienttasks.arch + "' '" + procCpuInfoFacts.get("proc_cpuinfo.common.model") + "' '" + procCpuInfoFacts.get("proc_cpuinfo.common.platform") + "' platform.");
} else
// END OF WORKAROUND
// assert virt.is_guest is False
Assert.assertEquals(virtIsGuest, Boolean.FALSE, "The virt.is_guest fact value is false on a '" + clienttasks.arch + "' '" + procCpuInfoFacts.get("proc_cpuinfo.common.model") + "' '" + procCpuInfoFacts.get("proc_cpuinfo.common.platform") + "' platform because file '" + procDeviceTreeVmUuidFile + "' does not exist.");
// assert virt.uuid is null
Assert.assertNull(virtUuid, "The virt.uuid fact is null on a '" + clienttasks.arch + "' '" + procCpuInfoFacts.get("proc_cpuinfo.common.model") + "' '" + procCpuInfoFacts.get("proc_cpuinfo.common.platform") + "' platform.");
}
}
// TODO assert specific proc_cpuinfo.common facts are now collected on x86_64
// TODO assert specific proc_cpuinfo.common facts are now collected on aarch64
}
Aggregations