def run():
    client = Client()
    client.login(username=SUPERUSER_USERNAME,
                 password=SUPERUSER_PASSWORD)
    
    # Add all planetlab aggregates
    for pl_agg in PL_AGGREGATE_INFO:
        print "adding pl agg %s" % pl_agg["url"]
        response = test_get_and_post_form(
            client,
            reverse("planetlab_aggregate_create"),
            pl_agg,
        )
        print "got response %s" % response
        assert response.status_code == 302
        
    for of_agg in OF_AGGREGATE_INFO:
        print "adding of agg %s" % of_agg["url"]
        response = test_get_and_post_form(
            client,
            reverse("openflow_aggregate_create"),
            of_agg,
            del_params=["verify_certs"],
        )
        assert response.status_code == 302
        
    for cnxn_tuple in OF_PL_CONNECTIONS:
        print "adding cnxn %s" % (cnxn_tuple,)
        NonOpenFlowConnection.objects.get_or_create(
            of_iface=OpenFlowInterface.objects.get(
                switch__datapath_id=cnxn_tuple[0],
                port_num=cnxn_tuple[1],
            ),
            resource=PlanetLabNode.objects.get(name=cnxn_tuple[2]),
        )
    
    client.logout()
    
    for username, info in USER_INFO.items():
        # create user
        User.objects.create_user(
            username=username, email=info["email"], password=info["password"])
        
        client.login(username=username, password=info["password"])
        # create project and slice
        for project in info["projects"]:
            response = test_get_and_post_form(
                client, reverse("project_create"),
                params=dict(
                    name=project["name"],
                    description=project["description"],
                ),
            )
            assert response.status_code == 302
            # This code is missing the project id. Need to get somehow to use reverse.
            # for slice in project["slices"]:
            #     response = test_get_and_post_form(
            #         client, reverse("slice_create"),
            #         params=dict(
            #             name=slice["name"],
            #             description=slice["description"],
            #         ),
            #     )
            #     assert response.status_code == 302
        client.logout()
dataset/ETHPy150Open fp7-ofelia/ocf/optin_manager/src/python/scripts/setup_ch.py/run/original