Exemple #1
0
 def test_provision_mysql(self):
     """
     Provision mysql database
     """
     instance = OpenEdXInstanceFactory(use_ephemeral_databases=False)
     instance.provision_mysql()
     self.check_mysql(instance)
 def test_provision_mysql(self):
     """
     Provision mysql database
     """
     instance = OpenEdXInstanceFactory(use_ephemeral_databases=False)
     instance.provision_mysql()
     self.check_mysql(instance)
 def test_provision_mysql_no_url(self):
     """
     Don't provision a mysql database if INSTANCE_MYSQL_URL is not set
     """
     instance = OpenEdXInstanceFactory(use_ephemeral_databases=False)
     instance.provision_mysql()
     databases = subprocess.check_output("mysql -u root -e 'SHOW DATABASES'", shell=True).decode()
     for database in instance.mysql_database_names:
         self.assertNotIn(database, databases)
Exemple #4
0
 def test_provision_mysql_no_url(self):
     """
     Don't provision a mysql database if INSTANCE_MYSQL_URL is not set
     """
     instance = OpenEdXInstanceFactory(use_ephemeral_databases=False)
     instance.provision_mysql()
     databases = subprocess.check_output(
         "mysql -u root -e 'SHOW DATABASES'", shell=True).decode()
     for database in instance.mysql_database_names:
         self.assertNotIn(database, databases)
Exemple #5
0
 def test_provision_mysql_weird_domain(self):
     """
     Make sure that database names are escaped correctly
     """
     sub_domain = 'really.really.really.really.long.subdomain'
     base_domain = 'this-is-a-really-long-unusual-domain-แปลกมาก.com'
     instance = OpenEdXInstanceFactory(use_ephemeral_databases=False,
                                       sub_domain=sub_domain,
                                       base_domain=base_domain)
     instance.provision_mysql()
     self.check_mysql(instance)
 def test_provision_mysql_weird_domain(self):
     """
     Make sure that database names are escaped correctly
     """
     sub_domain = 'really.really.really.really.long.subdomain'
     base_domain = 'this-is-a-really-long-unusual-domain-แปลกมาก.com'
     instance = OpenEdXInstanceFactory(use_ephemeral_databases=False,
                                       sub_domain=sub_domain,
                                       base_domain=base_domain)
     instance.provision_mysql()
     self.check_mysql(instance)
Exemple #7
0
    def test_provision_mysql_again(self):
        """
        Only create the database once
        """
        instance = OpenEdXInstanceFactory(use_ephemeral_databases=False)
        instance.provision_mysql()
        self.assertIs(instance.mysql_provisioned, True)

        mysql_user = instance.mysql_user
        mysql_pass = instance.mysql_pass
        instance.provision_mysql()
        self.assertEqual(instance.mysql_user, mysql_user)
        self.assertEqual(instance.mysql_pass, mysql_pass)
        self.check_mysql(instance)
    def test_provision_mysql_again(self):
        """
        Only create the database once
        """
        instance = OpenEdXInstanceFactory(use_ephemeral_databases=False)
        instance.provision_mysql()
        self.assertIs(instance.mysql_provisioned, True)

        mysql_user = instance.mysql_user
        mysql_pass = instance.mysql_pass
        instance.provision_mysql()
        self.assertEqual(instance.mysql_user, mysql_user)
        self.assertEqual(instance.mysql_pass, mysql_pass)
        self.check_mysql(instance)