Index: wp-testlib/base.php
===================================================================
--- wp-testlib/base.php	(revision 110)
+++ wp-testlib/base.php	(revision 112)
@@ -320,5 +320,55 @@
 	}
 
-
+	/**
+	 * Checks if track ticket #$ticket_id is resolved 
+	 *
+	 * @return bool|null true if the ticket is resolved, false if not resolved, null on error
+	 */
+	function isTracTicketClosed($trac_url, $ticket_id) {
+		#TODO: cache it or provide a way to disable the checks and return false
+		$trac_url = rtrim($trac_url, '/');
+		$ticket_tsv = file_get_contents("$trac_url/ticket/$ticket_id?format=tab");
+		if (false === $ticket_tsv) {
+			return null;
+		}
+		$lines = explode("\n", $ticket_tsv);
+		if (!is_array($lines) || count($lines) < 2) {
+			return null;
+		}
+		$titles = explode("\t", $lines[0]);
+		$status_idx = array_search('status', $titles);
+		if (false === $status_idx) {
+			return null;
+		}
+		$tabs = explode("\t", $lines[1]);
+		return 'closed' === $tabs[$status_idx];
+	}
+
+	/**
+	 * Skips the current test if there is open WordPress ticket with id $ticket_id
+	 */
+	function knownWPBug($ticket_id) {
+		if (!$this->isTracTicketClosed('http://trac.wordpress.org', $ticket_id)) {
+			$this->markTestSkipped();
+		}
+	}
+
+	/**
+	 * Skips the current test if there is open WordPress MU ticket with id $ticket_id
+	 */
+	function knownMUBug($ticket_id) {
+		if (!$this->isTracTicketClosed('http://trac.mu.wordpress.org', $ticket_id)) {
+			$this->markTestSkipped();
+		}
+	}
+
+	/**i
+	 * Skips the current test if there is open plugin ticket with id $ticket_id
+	 */
+	function knownPluginBug($ticket_id) {
+		if (!$this->isTracTicketClosed('http://dev.wp-plugins.org', $ticket_id)) {
+			$this->markTestSkipped();
+		}
+	}
 }
 
