Exemplo n.º 1
0
def https_put(exposerecord, data, range_start=None, vdi_size=None):
    connection = httplib.HTTPSConnection(exposerecord['ip'],
                                         int(exposerecord['port']))
    try:
        return http_test.http_put_request(connection, exposerecord, data,
                                          range_start, vdi_size)
    finally:
        connection.close()
Exemplo n.º 2
0
    def testSendMultiplePutRequestsInOneHttpsSession(self):
        hostname, network, vdi = testsetup.setup_host_and_network(templates=1, vdi_mb=16)
        transferclient.expose(hostname, vdi_uuid=vdi, network_uuid=network, transfer_mode='http', use_ssl='true')
        record = transferclient.get_record(hostname, vdi_uuid=vdi)

        conn = httplib.HTTPSConnection(record['ip'], int(record['port']))
        try:
            for i in xrange(1, 5):
                data = 'a' * (i * 100*K)
                status, headers = http_test.http_put_request(conn, record, data, i * M * 2 + 234*K, 16*M)
                self.assertEqual(status, 200)
        finally:
            conn.close()
Exemplo n.º 3
0
    def testSendMultiplePutRequestsInOneHttpsSession(self):
        hostname, network, vdi = testsetup.setup_host_and_network(templates=1,
                                                                  vdi_mb=16)
        transferclient.expose(hostname,
                              vdi_uuid=vdi,
                              network_uuid=network,
                              transfer_mode='http',
                              use_ssl='true')
        record = transferclient.get_record(hostname, vdi_uuid=vdi)

        conn = httplib.HTTPSConnection(record['ip'], int(record['port']))
        try:
            for i in xrange(1, 5):
                data = 'a' * (i * 100 * K)
                status, headers = http_test.http_put_request(
                    conn, record, data, i * M * 2 + 234 * K, 16 * M)
                self.assertEqual(status, 200)
        finally:
            conn.close()
Exemplo n.º 4
0
def https_put(exposerecord, data, range_start=None, vdi_size=None):
    connection = httplib.HTTPSConnection(exposerecord['ip'], int(exposerecord['port']))
    try:
        return http_test.http_put_request(connection, exposerecord, data, range_start, vdi_size)
    finally:
        connection.close()