use of com.redhat.qe.auto.bugzilla.BugzillaAPIException in project rhsm-qe by RedHatQE.
the class ComplianceTests method configureProductCertDirForAllProductsSubscribableInTheFuture.
@BeforeGroups(groups = { "setup" }, value = "configureProductCertDirForAllProductsSubscribableInTheFuture")
public void configureProductCertDirForAllProductsSubscribableInTheFuture() {
clienttasks.unregister(null, null, null, null);
// TEMPORARY WORKAROUND FOR BUG: Bug 1183175 - changing to a different rhsm.productcertdir configuration throws OSError: [Errno 17] File exists
boolean invokeWorkaroundWhileBugIsOpen = true;
String bugId = "1183175";
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) {
throw new SkipException("Cannot configure a different productCertDir while bug '" + bugId + "' is open.");
}
// END OF WORKAROUND
clienttasks.updateConfFileParameter(clienttasks.rhsmConfFile, "productCertDir", productCertDirForAllProductsSubscribableInTheFuture);
SSHCommandResult r = client.runCommandAndWait("ls -1 " + productCertDirForAllProductsSubscribableInTheFuture + " | wc -l");
if (Integer.valueOf(r.getStdout().trim()) == 0)
throw new SkipException("Could not find any installed product certs that are subscribable to future available subscriptions.");
Assert.assertTrue(Integer.valueOf(r.getStdout().trim()) > 0, "The " + clienttasks.rhsmConfFile + " file is currently configured with a productCertDir that contains all subscribable products based on future available subscriptions.");
configureProductCertDirForAllProductsSubscribableInTheFutureCompleted = true;
}
use of com.redhat.qe.auto.bugzilla.BugzillaAPIException in project rhsm-qe by RedHatQE.
the class ComplianceTests method configureProductCertDirForAllProductsSubscribableByMoreThanOneCommonServiceLevel.
@BeforeGroups(groups = { "setup" }, value = "configureProductCertDirForAllProductsSubscribableByMoreThanOneCommonServiceLevel")
public void configureProductCertDirForAllProductsSubscribableByMoreThanOneCommonServiceLevel() {
clienttasks.unregister(null, null, null, null);
// TEMPORARY WORKAROUND FOR BUG: Bug 1183175 - changing to a different rhsm.productcertdir configuration throws OSError: [Errno 17] File exists
boolean invokeWorkaroundWhileBugIsOpen = true;
String bugId = "1183175";
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) {
throw new SkipException("Cannot configure a different productCertDir while bug '" + bugId + "' is open.");
}
// END OF WORKAROUND
clienttasks.updateConfFileParameter(clienttasks.rhsmConfFile, "productCertDir", productCertDirForAllProductsSubscribableByMoreThanOneCommonServiceLevel);
SSHCommandResult r = client.runCommandAndWait("ls -1 " + productCertDirForAllProductsSubscribableByMoreThanOneCommonServiceLevel + " | wc -l");
if (Integer.valueOf(r.getStdout().trim()) == 0)
throw new SkipException("Could not find any installed product certs that are autosubscribable via more than one common service level.");
Assert.assertTrue(Integer.valueOf(r.getStdout().trim()) > 0, "The " + clienttasks.rhsmConfFile + " file is currently configured with a productCertDir that contains all autosubscribable products via more than one common service level.");
configureProductCertDirForAllProductsSubscribableByMoreThanOneCommonServiceLevelCompleted = true;
}
use of com.redhat.qe.auto.bugzilla.BugzillaAPIException in project rhsm-qe by RedHatQE.
the class ComplianceTests method configureProductCertDirForSomeProductsSubscribable.
@BeforeGroups(groups = { "setup" }, value = "configureProductCertDirForSomeProductsSubscribable")
public void configureProductCertDirForSomeProductsSubscribable() {
clienttasks.unregister(null, null, null, null);
// TEMPORARY WORKAROUND FOR BUG: Bug 1183175 - changing to a different rhsm.productcertdir configuration throws OSError: [Errno 17] File exists
boolean invokeWorkaroundWhileBugIsOpen = true;
String bugId = "1183175";
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) {
throw new SkipException("Cannot configure a different productCertDir while bug '" + bugId + "' is open.");
}
// END OF WORKAROUND
clienttasks.updateConfFileParameter(clienttasks.rhsmConfFile, "productCertDir", productCertDirForSomeProductsSubscribable);
SSHCommandResult r0 = client.runCommandAndWait("ls -1 " + productCertDirForSomeProductsSubscribable + " | wc -l");
SSHCommandResult r1 = client.runCommandAndWait("ls -1 " + productCertDirForAllProductsSubscribable + " | wc -l");
SSHCommandResult r2 = client.runCommandAndWait("ls -1 " + productCertDirForNoProductsSubscribable + " | wc -l");
if (Integer.valueOf(r1.getStdout().trim()) == 0)
throw new SkipException("Could not find any installed product certs that are subscribable based on the currently available subscriptions.");
if (Integer.valueOf(r2.getStdout().trim()) == 0)
throw new SkipException("Could not find any installed product certs that are non-subscribable based on the currently available subscriptions.");
Assert.assertTrue(Integer.valueOf(r0.getStdout().trim()) > 0 && Integer.valueOf(r1.getStdout().trim()) > 0 && Integer.valueOf(r2.getStdout().trim()) > 0, "The " + clienttasks.rhsmConfFile + " file is currently configured with a productCertDir that contains some subscribable products based on the currently available subscriptions.");
configureProductCertDirForSomeProductsSubscribableCompleted = true;
}
use of com.redhat.qe.auto.bugzilla.BugzillaAPIException in project rhsm-qe by RedHatQE.
the class ComplianceTests method configureProductCertDirForNoProductsInstalled.
@BeforeGroups(groups = { "setup" }, value = "configureProductCertDirForNoProductsInstalled")
public void configureProductCertDirForNoProductsInstalled() {
clienttasks.unregister(null, null, null, null);
// TEMPORARY WORKAROUND FOR BUG: Bug 1183175 - changing to a different rhsm.productcertdir configuration throws OSError: [Errno 17] File exists
boolean invokeWorkaroundWhileBugIsOpen = true;
String bugId = "1183175";
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) {
throw new SkipException("Cannot configure a different productCertDir while bug '" + bugId + "' is open.");
}
// END OF WORKAROUND
clienttasks.updateConfFileParameter(clienttasks.rhsmConfFile, "productCertDir", productCertDirForNoProductsinstalled);
SSHCommandResult r = client.runCommandAndWait("ls -1 " + productCertDirForNoProductsinstalled + " | wc -l");
Assert.assertEquals(Integer.valueOf(r.getStdout().trim()), Integer.valueOf(0), "The " + clienttasks.rhsmConfFile + " file is currently configured with a productCertDir that contains no products.");
configureProductCertDirForNoProductsInstalledCompleted = true;
}
use of com.redhat.qe.auto.bugzilla.BugzillaAPIException in project rhsm-qe by RedHatQE.
the class ComplianceTests method configureProductCertDirForAllProductsSubscribable.
@BeforeGroups(groups = { "setup" }, value = "configureProductCertDirForAllProductsSubscribable")
public void configureProductCertDirForAllProductsSubscribable() {
clienttasks.unregister(null, null, null, null);
// TEMPORARY WORKAROUND FOR BUG: Bug 1183175 - changing to a different rhsm.productcertdir configuration throws OSError: [Errno 17] File exists
boolean invokeWorkaroundWhileBugIsOpen = true;
String bugId = "1183175";
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) {
throw new SkipException("Cannot configure a different productCertDir while bug '" + bugId + "' is open.");
}
// END OF WORKAROUND
clienttasks.updateConfFileParameter(clienttasks.rhsmConfFile, "productCertDir", productCertDirForAllProductsSubscribable);
SSHCommandResult r = client.runCommandAndWait("ls -1 " + productCertDirForAllProductsSubscribable + " | wc -l");
if (Integer.valueOf(r.getStdout().trim()) == 0)
throw new SkipException("Could not find any installed product certs that are subscribable based on the currently available subscriptions.");
Assert.assertTrue(Integer.valueOf(r.getStdout().trim()) > 0, "The " + clienttasks.rhsmConfFile + " file is currently configured with a productCertDir that contains all subscribable products based on the currently available subscriptions.");
configureProductCertDirForAllProductsSubscribableCompleted = true;
}
Aggregations