def run_block2(address, block_size):
    """Runs block2 test"""
    response = b'This is RIOT \\(Version'

    host = ExpectHost(
        pwd, './block2_client.py -r [{0}] -b {1}'.format(address, block_size))

    output = host.run()
    assert re.search(b'2.05 Content', output)
    assert re.search(response, output)
예제 #2
0
def run_block1(server_addr, block_size):
    """Runs block1 test"""
    signature = b'C496DF5946783990BEC5EFDC2999530EEB9175B83094BAE66170FF2431FC896E'

    cmd = './block1_client.py -r [{0}] -b {1}'
    host = ExpectHost(pwd, cmd.format(server_addr, block_size))

    output = host.run()
    assert re.search(b'2.04 Changed', output)
    assert re.search(signature, output)
예제 #3
0
def run_block2(address, block_size):
    """Runs block2 test"""
    response = b'This is RIOT \\(Version'

    cmdText = './block2_client.py -r [{0}] -b {1} {2}'
    cmd = cmdText.format(address, block_size,
                         '-c dtls-credentials.json' if proto_params['is_dtls'] else '')
    host = ExpectHost(pwd, cmd)

    output = host.run()
    assert re.search(b'2.05 Content', output)
    assert re.search(response, output)
예제 #4
0
def run_block1(server_addr, block_size):
    """Runs block1 test"""
    signature = b'C496DF5946783990BEC5EFDC2999530EEB9175B83094BAE66170FF2431FC896E'

    cmd = './block1_client.py -r [{0}] -b {1} {2}'
    host = ExpectHost(
        pwd,
        cmd.format(
            server_addr, block_size,
            '-c dtls-credentials.json' if proto_params['is_dtls'] else ''))

    output = host.run()
    assert re.search(b'2.04 Changed', output)
    assert re.search(signature, output)