Example #1
0
    print "Stddev:", stddev
    print "Total time:", time.time() - start_time

    # Would be lovely to get Neutron to tell on itself: how many
    # times did it retry giving us these results, how many of those
    # were policy related, collisions with other procs, and deadlocks?
    #
    # Ways this could work:
    #
    # Send a POST to an admin extension -> stats mode
    # Things we care about honor stats mode, pushing data into memory
    # Send a DELETE to admin extension -> stats mode is off
    # GET on the extension -> Get stat dump

    # Would also be lovely to have an exhaust subnet test, see how far it goes,
    # see if it actually generated *all* the IPs in the subnet, and so on.

    teardown_results = [pool.apply_async(teardown, (p,))
                        for s, t, p in results if p]
    print "Issued all teardowns, waiting for final cleanup..."
    for res in teardown_results:
        res.wait()


if __name__ == "__main__":
    path = None
    if len(sys.argv) > 1:
        path = sys.argv[1]
    horde.load_conf(path)
    horde.run_tests(runner='', process_results='', teardown='')
Example #2
0
            "subnet": {"network_id": net_resource["network"]["id"], "cidr": "192.168.0.0/24", "ip_version": 4}
        }
        port_dict = {"port": {"network_id": net_resource["network"]["id"]}}
        subnet_resource = test_create(client, "subnet", subnet_dict)
        port_resource = test_create(client, "port", port_dict)

        test_list(client, "ports", port_resource["port"])
        test_list(client, "subnets", subnet_resource["subnet"])
        test_list(client, "networks", net_resource["network"])

        test_show(client, "port", port_resource["port"])
        test_show(client, "subnet", subnet_resource["subnet"])
        test_show(client, "network", net_resource["network"])

        print "Network, subnet and port created"
    except Exception as e:
        print e
    finally:
        _rescue_nil(client.delete_port, port_resource["port"]["id"])
        _rescue_nil(client.delete_subnet, subnet_resource["subnet"]["id"])
        _rescue_nil(client.delete_network, net_resource["network"]["id"])
        print "Finished deleteing network, subnet and port"


if __name__ == "__main__":
    path = None
    if len(sys.argv) > 1:
        path = sys.argv[1]
    horde.load_conf(path)
    horde.run_tests(endpoint_test)