mirror of https://github.com/apache/cloudstack.git
marvin_refactor: AccountFactory doesn't need hashing
SHA encryption is applied by the server
This commit is contained in:
parent
d84535ee10
commit
048352f2f6
|
|
@ -15,8 +15,8 @@
|
|||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import hashlib
|
||||
from marvin.factory.CloudStackBaseFactory import *
|
||||
import factory
|
||||
from marvin.factory.CloudStackBaseFactory import CloudStackBaseFactory
|
||||
from marvin.base import Account
|
||||
from marvin.utils import random_gen
|
||||
|
||||
|
|
@ -30,11 +30,7 @@ class AccountFactory(CloudStackBaseFactory):
|
|||
lastname = factory.Sequence(lambda n: random_gen())
|
||||
email = factory.LazyAttribute(lambda e: '{0}.{1}@cloudstack.org'.format(e.firstname, e.lastname).lower())
|
||||
username = factory.Sequence(lambda n: random_gen())
|
||||
|
||||
# Password Encoding
|
||||
mdf = hashlib.md5()
|
||||
mdf.update('password')
|
||||
password = mdf.hexdigest()
|
||||
password = 'password'
|
||||
|
||||
|
||||
class AdminAccountFactory(AccountFactory):
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import Template
|
||||
from marvin.factory import CloudStackBaseFactory
|
||||
from marvin.factory.CloudStackBaseFactory import CloudStackBaseFactory
|
||||
|
||||
class TemplateFactory(CloudStackBaseFactory):
|
||||
|
||||
|
|
|
|||
|
|
@ -15,12 +15,12 @@
|
|||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from marvin.base import VirtualMachine
|
||||
from marvin.factory import CloudStackBaseFactory
|
||||
from marvin.base.VirtualMachine import VirtualMachine
|
||||
from marvin.factory.CloudStackBaseFactory import CloudStackBaseFactory
|
||||
|
||||
class VirtualMachineFactory(CloudStackBaseFactory):
|
||||
|
||||
FACTORY_FOR = VirtualMachine.VirtualMachine
|
||||
FACTORY_FOR = VirtualMachine
|
||||
|
||||
serviceofferingid = None
|
||||
templateid = None
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ from marvin.utils import random_gen
|
|||
|
||||
class ZoneFactory(CloudStackBaseFactory):
|
||||
|
||||
FACTORY_FOR = Zone
|
||||
FACTORY_FOR = Zone.Zone
|
||||
|
||||
dns1 = "8.8.8.8"
|
||||
internaldns1 = "8.8.8.8"
|
||||
|
|
|
|||
|
|
@ -17,22 +17,24 @@
|
|||
|
||||
import unittest
|
||||
import logging
|
||||
|
||||
from marvin.cloudstackTestClient import cloudstackTestClient
|
||||
from marvin.base import Account, Zone, Template, User
|
||||
|
||||
from marvin.factory.AccountFactory import *
|
||||
|
||||
from marvin.factory.ServiceOfferingFactory import *
|
||||
|
||||
from marvin.factory.NetworkOfferingFactory import *
|
||||
|
||||
from marvin.factory.TemplateFactory import *
|
||||
|
||||
from marvin.factory.VirtualMachineFactory import *
|
||||
|
||||
from marvin.factory.UserFactory import *
|
||||
|
||||
|
||||
from marvin.base.Zone import *
|
||||
from marvin.base.Account import Account
|
||||
from marvin.base.Template import Template
|
||||
|
||||
|
||||
|
||||
|
||||
class BuildVsCreateStrategyTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.apiClient = cloudstackTestClient(mgtSvr='localhost', logging=logging.getLogger('factories.cloudstack')).getApiClient()
|
||||
|
|
|
|||
Loading…
Reference in New Issue