tests/integration/conftest.py
def host_with_cmd():
    """
    Host with a command on the queue
    """
    host = Host.get(a_name(), create=True)
    pkey = getenv('SERA_CLIENT_PUBLIC_KEY')
    cmd = {'name': 'echo'}
    encrypted = encrypt(json.dumps(cmd), pkey, getenv('SERA_CLIENT_PRIVATE_KEY'))
    sqs().send_message(
        QueueUrl=host.url,
        MessageBody=json.dumps('decrypt %s' % pkey),
        MessageAttributes={
            'Sender': {'StringValue': host.uid, 'DataType': 'String'},
            'Encrypted': {'BinaryValue': encrypted, 'DataType': 'Binary'}
        })
    yield host, cmd['name'], pkey
    sqs().delete_queue(QueueUrl=host.url)

    Host with a command on the queue
    
Host with a command on the queue
Host with a command on the queue
def host_with_cmd():
    host = Host.get(a_name(), create=True)
    pkey = getenv('SERA_CLIENT_PUBLIC_KEY')
    cmd = {'name': 'echo'}
    encrypted = encrypt(json.dumps(cmd), pkey, getenv('SERA_CLIENT_PRIVATE_KEY'))
    sqs().send_message(
        QueueUrl=host.url,
        MessageBody=json.dumps('decrypt %s' % pkey),
        MessageAttributes={
            'Sender': {'StringValue': host.uid, 'DataType': 'String'},
            'Encrypted': {'BinaryValue': encrypted, 'DataType': 'Binary'}
        })
    yield host, cmd['name'], pkey
    sqs().delete_queue(QueueUrl=host.url)
def host_with_cmd ( ) : host = Host . get ( a_name ( ) , create = True ) pkey = getenv ( 'SERA_CLIENT_PUBLIC_KEY' ) cmd = { 'name' : 'echo' } encrypted = encrypt ( json . dumps ( cmd ) , pkey , getenv ( 'SERA_CLIENT_PRIVATE_KEY' ) ) sqs ( ) . send_message ( QueueUrl = host . url , MessageBody = json . dumps ( 'decrypt %s' % pkey ) , MessageAttributes = { 'Sender' : { 'StringValue' : host . uid , 'DataType' : 'String' } , 'Encrypted' : { 'BinaryValue' : encrypted , 'DataType' : 'Binary' } } ) yield host , cmd [ 'name' ] , pkey sqs ( ) . delete_queue ( QueueUrl = host . url )
Host with a command on the queue
Host with a command on the queue
"""
    Host with a command on the queue
    """