]> WPIA git - gigi.git/blobdiff - tests/org/cacert/gigi/testUtils/PingTest.java
[test-config] FIX: the ssl-pinger+ add various tests for that.
[gigi.git] / tests / org / cacert / gigi / testUtils / PingTest.java
index bc844c4870bcf1198df4c85459f03b00822b47bb..b8c0d9105211bae9b4c699601f803df84d213959 100644 (file)
@@ -27,7 +27,8 @@ public abstract class PingTest extends ClientTest {
 
     protected void waitForPings(int count) throws SQLException, InterruptedException {
         PreparedStatement ps = DatabaseConnection.getInstance().prepare("SELECT COUNT(*) FROM domainPinglog");
-        while (true) {
+        long start = System.currentTimeMillis();
+        while (System.currentTimeMillis() - start < 10000) {
             ResultSet rs = ps.executeQuery();
             rs.next();
             if (rs.getInt(1) >= count) {
@@ -58,7 +59,7 @@ public abstract class PingTest extends ClientTest {
         String content1 = IOUtils.readURL(openConnection);
         csrf = getCSRF(1, content1);
 
-        Pattern p = Pattern.compile("cacert-([A-Za-z0-9]+) IN TXT ([A-Za-z0-9]+)");
+        Pattern p = Pattern.compile("([A-Za-z0-9]+)._cacert._auth IN TXT ([A-Za-z0-9]+)");
         Matcher m = p.matcher(content1);
         m.find();
         return m;