use of org.jenkinsci.test.acceptance.plugins.mail_watcher.OnlineStatusNotification in project acceptance-test-harness by jenkinsci.
the class MailWatcherPluginTest method notify_master_on_jenkins_restart.
@Test
@Issue("JENKINS-20538")
@Since("1.571")
@WithPlugins("mail-watcher-plugin@1.7")
@Ignore("Flaky test, passes sometimes on CI")
public void notify_master_on_jenkins_restart() throws Exception {
assumeTrue("This test requires a restartable Jenkins", jenkins.canRestart());
jenkins.configure();
{
OnlineStatusNotification notification = new OnlineStatusNotification(jenkins);
notification.onOnline("on@online.com");
notification.onOffline("on@offline.com");
}
jenkins.save();
jenkins.restart();
mailhog.assertMail(regex("Computer master marked offline"), "on@offline.com", regex("Jenkins is restarting"));
mailhog.assertMail(regex("Computer master marked online"), "on@online.com");
}
use of org.jenkinsci.test.acceptance.plugins.mail_watcher.OnlineStatusNotification in project acceptance-test-harness by jenkinsci.
the class MailWatcherPluginTest method notify_slave_on_restart.
@Test
public void notify_slave_on_restart() throws Exception {
assumeTrue("This test requires a restartable Jenkins", jenkins.canRestart());
Future<Slave> futureSlave = slaveController.install(jenkins);
Slave slave = futureSlave.get();
slave.configure();
{
OnlineStatusNotification notification = new OnlineStatusNotification(slave);
notification.onOnline("on@online.com");
notification.onOffline("on@offline.com");
}
slave.save();
jenkins.restart();
mailhog.assertMail(regex("Computer %s marked offline", slave.getName()), "on@offline.com");
mailhog.assertMail(regex("Computer %s marked online", slave.getName()), "on@online.com");
}
Aggregations