Esempio n. 1
0
    def setUp(self):
        # Create the clearinghouse user
        username = "******"
        password = "******"
        u = User.objects.create(username=username)
        u.set_password(password)
        u.save()

        profile = UserProfile.get_or_create_profile(u)
        profile.is_clearinghouse_user = True
        profile.save()

        url = "http://%s:80/xmlrpc/xmlrpc/" % (HOST, )
        self.om_client = BasicAuthServerProxy(url,
                                              username=username,
                                              password=password,
                                              transport=TestClientTransport())
        # Create dummy FV
        fv = DummyFV.objects.create()
        # Load up a fake topology in the Dummy FV
        fv.populateTopology(10, 20, use_random=USE_RANDOM)

        # create fake users for the Dummy FV
        username = "******"
        password = "******"
        u = User.objects.create(username=username)
        u.set_password(password)
        u.save()

        # Create the FV proxy connection
        FVServerProxy.objects.create(
            name="Flowvisor",
            username=username,
            password=password,
            url=SCHEME + "://%s:8443/dummyfv/1/xmlrpc/" % (HOST, ),
        )

        self.test_admin = User.objects.create_superuser(
            "admin", "*****@*****.**", "password")