Files
        @ 081b8258b26a
    
        
              Branch filter: 
        
    Location: libtransport.git/tests/runtests.py - annotation
        
            
            081b8258b26a
            1.5 KiB
            text/x-python
        
        
    
    Added ConnectionError enum to protocol.proto
    | b74fb0544e32 b74fb0544e32 b74fb0544e32 b74fb0544e32 b74fb0544e32 2a40419b2bc4 2a40419b2bc4 b74fb0544e32 b74fb0544e32 b74fb0544e32 b74fb0544e32 b74fb0544e32 b74fb0544e32 b74fb0544e32 b74fb0544e32 b74fb0544e32 b74fb0544e32 b74fb0544e32 b74fb0544e32 b74fb0544e32 b74fb0544e32 b74fb0544e32 b74fb0544e32 b74fb0544e32 2a40419b2bc4 568d2e62b7e7 b74fb0544e32 b74fb0544e32 04f7a0378047 04f7a0378047 04f7a0378047 b74fb0544e32 04f7a0378047 568d2e62b7e7 b74fb0544e32 b74fb0544e32 04f7a0378047 04f7a0378047 568d2e62b7e7 04f7a0378047 b74fb0544e32 f8d3089f4e3a f8d3089f4e3a f8d3089f4e3a 04f7a0378047 a9fbe73b8025 04f7a0378047 04f7a0378047 04f7a0378047 04f7a0378047 a9fbe73b8025 04f7a0378047 04f7a0378047 04f7a0378047 04f7a0378047 04f7a0378047 04f7a0378047 04f7a0378047 568d2e62b7e7 2a40419b2bc4 04f7a0378047 04f7a0378047 04f7a0378047 04f7a0378047 04f7a0378047 04f7a0378047 b74fb0544e32 f8d3089f4e3a b74fb0544e32 b74fb0544e32 | import os
import sys
from subprocess import *
import time
def run_spectrum(backend, test):
	os.system("rm test.sql")
	f = open("sample.cfg", "w")
	f.write("\
	[service]\n\
	jid = localhost\n\
	password = secret\n\
	server = 127.0.0.1\n\
	port = 5222\n\
	server_mode = 1\n\
	backend=../backends/%s/%s_backend\n\
	protocol=prpl-jabber\n\
\
	[database]\n\
	database = test.sql\n\
	prefix=icq\n\
	" % (backend, backend)
	)
	f.close()
	p = Popen("../spectrum/src/spectrum sample.cfg > " + backend + "_" + test + ".log 2>&1", shell=True)
	time.sleep(4)
	return p
def one_test_run():
	os.system("killall spectrum 2> /dev/null")
	os.system("rm *.log")
	for backend in os.listdir("../backends"):
		if not os.path.isdir("../backends/" + backend) or backend == "CMakeFiles":
			continue
		for d in os.listdir("."):
			binary = d + "/" + d + "_test"
			if not os.path.exists(binary):
				continue
			if os.path.exists(d + "/.no" + backend):
				continue
			p = run_spectrum(backend, d)
			if backend.find("purple") >= 0:
				p = Popen(binary + " pyjim%jabber.cz@localhost test", shell=True)
			else:
				p = Popen(binary + " testnickname%irc.freenode.net@localhost test", shell=True)
			seconds = 0
			while p.poll() is None and seconds < 20:
				time.sleep(1)
				seconds += 1
			if p.returncode == 0 and seconds < 20:
				print "[ PASS ]", backend, binary
				
			else:
				if seconds == 20:
					print "[ TIME ]", backend, binary
				else:
					print "[ FAIL ]", backend, binary
			os.system("killall spectrum 2> /dev/null")
one_test_run()
 |