def test_8bits(): leosac = LeosacRunner("this_test/config-8bits.xml") wiegand = WiegandClient("/tmp/leosac-ipc", "wiegand_data_high", "wiegand_data_low") time.sleep(3) wiegand.send_8bits_pin("31337") leosac.run_at_most(7) test_assert(leosac.returncode == 0, "Process returned with non-zero exit code ({0})".format(leosac.returncode)) ret = re.search("^.* 31337$", leosac.out, re.MULTILINE) test_assert(ret, "8bits Pin code wasn't read")
def main(): leosac = LeosacRunner("this_test/test-module-list.xml") rc = RemoteController("127.0.0.1:12345", "TJz$:^DbZvFN@wv/ct&[Su6Nnu6w!fMGHEcIttyT") cmd = ModuleListCommand() rc.execute_command(cmd) test_assert(cmd.status is True and ("MONITOR" in cmd.modules) and ("WIEGAND_READER" in cmd.modules) and ("NOT_A_MODULE" not in cmd.modules), "Failed to retrieve config from valid module.") leosac.run_at_most(10)
def main(): leosac = LeosacRunner("this_test/test-module-list.xml") rc = RemoteController("127.0.0.1:12345", "TJz$:^DbZvFN@wv/ct&[Su6Nnu6w!fMGHEcIttyT") cmd = ModuleListCommand() rc.execute_command(cmd) test_assert( cmd.status is True and ("MONITOR" in cmd.modules) and ("WIEGAND_READER" in cmd.modules) and ("NOT_A_MODULE" not in cmd.modules), "Failed to retrieve config from valid module.") leosac.run_at_most(10)
def receive_card_number(): tcp_server = subprocess.Popen(["this_test/tcp_server.py"]) leosac = LeosacRunner("this_test/config.xml") time.sleep(3) wiegand = WiegandClient("/tmp/leosac-ipc", "wiegand_data_high", "wiegand_data_low") wiegand.send_card("ff:ff:ff:ff") wiegand.send_card("00:00:00:10") tcp_server.wait() leosac.run_at_most(5) test_assert(tcp_server.returncode == 0, "TCPServer returned with non zero code") test_assert(leosac.returncode == 0, "Process returned with non-zero exit code ({0})".format(leosac.returncode))
def receive_card_number(): tcp_server = subprocess.Popen(["this_test/tcp_server.py"]) leosac = LeosacRunner("this_test/config.xml") time.sleep(3) wiegand = WiegandClient("/tmp/leosac-ipc", "wiegand_data_high", "wiegand_data_low") wiegand.send_card("ff:ff:ff:ff") wiegand.send_card("00:00:00:10") tcp_server.wait() leosac.run_at_most(5) test_assert(tcp_server.returncode == 0, "TCPServer returned with non zero code") test_assert( leosac.returncode == 0, "Process returned with non-zero exit code ({0})".format( leosac.returncode))