body1 = body1.replace('-a1-v1', '-v1-a1')
            body2 = body2.replace('-a1-v1', '-v1-a1')
            # must strip CF tokens since they sign the domain
            body1 = re.sub('&Signature=[^&]+', '&Signature=',
                           re.sub('\?Policy=[^&]+', '?Policy=', body1))
            body2 = re.sub('&Signature=[^&]+', '&Signature=',
                           re.sub('\?Policy=[^&]+', '?Policy=', body2))

        if body1.startswith('<?xml'):
            body1 = re.sub('<executionTime>[0-9\.]+<\/executionTime>', '',
                           body1)
            body2 = re.sub('<executionTime>[0-9\.]+<\/executionTime>', '',
                           body2)

        if body1.startswith('<html>'):
            body1 = body1.replace(' bgcolor="white"', '')
            body2 = body2.replace(' bgcolor="white"', '')

        if body1 != body2:
            self.writeOutput('Error: comparison failed - url1=%s, url2=%s' %
                             (url1, url2))
            self.writeOutput(body1)
            self.writeOutput(body2)
            return False

        return True


if __name__ == '__main__':
    stress_base.main(TestThread, STOP_FILE)
Esempio n. 2
0
			return False			
		
		if str(code1) != '200':
			self.writeOutput('Notice: got status code %s' % (code1))
			body1 = re.sub('nginx/\d+\.\d+\.\d+', 'nginx/0.0.0', body1)
			body2 = re.sub('nginx/\d+\.\d+\.\d+', 'nginx/0.0.0', body2)
		
		if (headers1.has_key('content-type') and 
			headers1['content-type'][0] in set(['application/vnd.apple.mpegurl', 'application/dash+xml'])):
			body1 = body1.replace(urlBase1, urlBase2)
			body1 = body1.replace('-a1-v1', '-v1-a1')
			body2 = body2.replace('-a1-v1', '-v1-a1')
			# must strip CF tokens since they sign the domain
			body1 = re.sub('&Signature=[^&]+', '&Signature=', re.sub('\?Policy=[^&]+', '?Policy=', body1))
			body2 = re.sub('&Signature=[^&]+', '&Signature=', re.sub('\?Policy=[^&]+', '?Policy=', body2))
		
		if body1.startswith('<?xml'):
			body1 = re.sub('<executionTime>[0-9\.]+<\/executionTime>', '', body1)
			body2 = re.sub('<executionTime>[0-9\.]+<\/executionTime>', '', body2)
			
		if body1 != body2:
			self.writeOutput('Error: comparison failed - url1=%s, url2=%s' % (url1, url2))
			self.writeOutput(body1)
			self.writeOutput(body2)
			return False
			
		return True

if __name__ == '__main__':
	stress_base.main(TestThread, STOP_FILE)