|
@@ -2788,6 +2788,16 @@ func TestUserS3Config(t *testing.T) {
|
|
|
}
|
|
|
|
|
|
func TestUserGCSConfig(t *testing.T) {
|
|
|
+ err := dataprovider.Close()
|
|
|
+ assert.NoError(t, err)
|
|
|
+ err = config.LoadConfig(configDir, "")
|
|
|
+ assert.NoError(t, err)
|
|
|
+ providerConf := config.GetProviderConf()
|
|
|
+ providerConf.PreferDatabaseCredentials = false
|
|
|
+ providerConf.CredentialsPath = credentialsPath
|
|
|
+ err = dataprovider.Initialize(providerConf, configDir, true)
|
|
|
+ assert.NoError(t, err)
|
|
|
+
|
|
|
user, _, err := httpdtest.AddUser(getTestUser(), http.StatusCreated)
|
|
|
assert.NoError(t, err)
|
|
|
err = os.RemoveAll(credentialsPath)
|
|
@@ -2860,6 +2870,18 @@ func TestUserGCSConfig(t *testing.T) {
|
|
|
|
|
|
_, err = httpdtest.RemoveUser(user, http.StatusOK)
|
|
|
assert.NoError(t, err)
|
|
|
+
|
|
|
+ err = dataprovider.Close()
|
|
|
+ assert.NoError(t, err)
|
|
|
+ err = config.LoadConfig(configDir, "")
|
|
|
+ assert.NoError(t, err)
|
|
|
+ providerConf = config.GetProviderConf()
|
|
|
+ providerConf.BackupsPath = backupsPath
|
|
|
+ providerConf.CredentialsPath = credentialsPath
|
|
|
+ err = os.RemoveAll(credentialsPath)
|
|
|
+ assert.NoError(t, err)
|
|
|
+ err = dataprovider.Initialize(providerConf, configDir, true)
|
|
|
+ assert.NoError(t, err)
|
|
|
}
|
|
|
|
|
|
func TestUserAzureBlobConfig(t *testing.T) {
|
|
@@ -8954,6 +8976,16 @@ func TestSFTPLoopError(t *testing.T) {
|
|
|
}
|
|
|
|
|
|
func TestLoginInvalidFs(t *testing.T) {
|
|
|
+ err := dataprovider.Close()
|
|
|
+ assert.NoError(t, err)
|
|
|
+ err = config.LoadConfig(configDir, "")
|
|
|
+ assert.NoError(t, err)
|
|
|
+ providerConf := config.GetProviderConf()
|
|
|
+ providerConf.PreferDatabaseCredentials = false
|
|
|
+ providerConf.CredentialsPath = credentialsPath
|
|
|
+ err = dataprovider.Initialize(providerConf, configDir, true)
|
|
|
+ assert.NoError(t, err)
|
|
|
+
|
|
|
u := getTestUser()
|
|
|
u.Filters.AllowAPIKeyAuth = true
|
|
|
u.FsConfig.Provider = sdk.GCSFilesystemProvider
|
|
@@ -8993,6 +9025,18 @@ func TestLoginInvalidFs(t *testing.T) {
|
|
|
assert.NoError(t, err)
|
|
|
err = os.RemoveAll(user.GetHomeDir())
|
|
|
assert.NoError(t, err)
|
|
|
+
|
|
|
+ err = dataprovider.Close()
|
|
|
+ assert.NoError(t, err)
|
|
|
+ err = config.LoadConfig(configDir, "")
|
|
|
+ assert.NoError(t, err)
|
|
|
+ providerConf = config.GetProviderConf()
|
|
|
+ providerConf.BackupsPath = backupsPath
|
|
|
+ providerConf.CredentialsPath = credentialsPath
|
|
|
+ err = os.RemoveAll(credentialsPath)
|
|
|
+ assert.NoError(t, err)
|
|
|
+ err = dataprovider.Initialize(providerConf, configDir, true)
|
|
|
+ assert.NoError(t, err)
|
|
|
}
|
|
|
|
|
|
func TestWebClientChangePwd(t *testing.T) {
|