diff --git a/.travis.yml b/.travis.yml index 197d2b25..94335483 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,10 @@ env: - DB=mysql:5.6 DB_EXTRA='' - DB=mysql:5.7 DB_EXTRA='' - DB=mysql:8.0 DB_EXTRA='mysqld --default-authentication-plugin=mysql_native_password' + - DB=mariadb:10.1 DB_EXTRA='' + - DB=mariadb:10.2 DB_EXTRA='' + - DB=mariadb:10.3 DB_EXTRA='' + - DB=mariadb:10.4 DB_EXTRA='' services: - docker @@ -34,7 +38,10 @@ script: echo 'Waiting for MySQL...' sleep 1; done; - - mysql -h${MYSQL_HOST} -P${MYSQL_PORT} -u${MYSQL_USERNAME} -e "INSTALL PLUGIN mysql_no_login SONAME 'mysql_no_login.so';" + - | + if [[ $DB =~ ^mysql ]]; then + mysql -h${MYSQL_HOST} -P${MYSQL_PORT} -u${MYSQL_USERNAME} -e "INSTALL PLUGIN mysql_no_login SONAME 'mysql_no_login.so';" + fi; - make testacc matrix: diff --git a/mysql/resource_user_test.go b/mysql/resource_user_test.go index 0d444f22..1ce1a203 100644 --- a/mysql/resource_user_test.go +++ b/mysql/resource_user_test.go @@ -4,6 +4,7 @@ import ( "database/sql" "fmt" "log" + "strings" "testing" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" @@ -52,7 +53,22 @@ func TestAccUser_basic(t *testing.T) { func TestAccUser_auth(t *testing.T) { resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { + testAccPreCheck(t) + db, err := connectToMySQL(testAccProvider.Meta().(*MySQLConfiguration)) + if err != nil { + return + } + + serverVersionString, err := serverVersionString(db) + if err != nil { + return + } + + if strings.Contains(serverVersionString, "MariaDB") { + t.Skip("MariaDB does not support the mysql_no_login plugin") + } + }, Providers: testAccProviders, CheckDestroy: testAccUserCheckDestroy, Steps: []resource.TestStep{