def ping_start_collect_feed(default_feed=None): _needs_targetenv() if default_feed: if not verify_url_content(" --data 'feed=%(default_feed)s' %(collector_url)s" % vars(), "Scheduled collect of", alternate_string_exists_in_content="is already scheduled for collect"): print "Failed to start collect of '%s'" % default_feed return main_host_and_port = env.roledefs['main'][0] if env.target!='dev_unix' else "%s:8180" % env.roledefs['main'][0] collector_url = "http://%s/collector" % main_host_and_port if env.target=='regression': feed_url = "http://%s/feed/current.atom" % env.roledefs['demosource'][0] if not verify_url_content(" --data 'feed=%(feed_url)s' %(collector_url)s" % vars(), "Scheduled collect of"): raise Exception("Scheduled collect failed") else: filename = "%(resources)s/%(target)s/datasources.n3" % venv() read_file = open(filename, 'r') for line in read_file: line = line.strip() if line.startswith('iana:current'): start_index = line.index('<') + 1 end_index = line.index('>') feed_url = line[start_index:end_index].strip() if feed_url=='http://rinfo.lagrummet.se/feed/current': continue if not verify_url_content(" --data 'feed=%(feed_url)s' %(collector_url)s" % vars(), "Scheduled collect of", alternate_string_exists_in_content="is already scheduled for collect"): print "Failed to start collect of '%s'" % feed_url
def ping_start_collect_admin(): _needs_targetenv() feed_url = '' if env.target=='regression': feed_url = "http://%s/feed/current.atom" % env.roledefs['demosource'][0] elif env.target=='dev_unix': feed_url = "http://%s:8280/feed/current.atom" % env.roledefs['admin'][0] else: feed_url = "http://%s/feed/current" % env.roledefs['admin'][0] main_host_and_port = env.roledefs['main'][0] if env.target!='dev_unix' else "%s:8180" % env.roledefs['main'][0] collector_url = "http://%s/collector" % main_host_and_port if not verify_url_content(" --data 'feed=%(feed_url)s' %(collector_url)s" % vars(), "Scheduled collect of"): raise Exception("Test failed")
def ping_start_collect(): _needs_targetenv() feed_url = "http://%s/feed/current" % env.roledefs['main'][0] collector_url = "http://%s/collector" % env.roledefs['service'][0] if not verify_url_content(" --data 'feed=%(feed_url)s' %(collector_url)s" % vars(), "Scheduled collect of"): raise Exception("Test failed")