Browse Source

fix check pwd hook when using memory provider

Nicola Murino 5 years ago
parent
commit
933427310d
1 changed files with 5 additions and 0 deletions
  1. 5 0
      sftpd/sftpd_test.go

+ 5 - 0
sftpd/sftpd_test.go

@@ -1534,12 +1534,17 @@ func TestCheckPwdHook(t *testing.T) {
 		assert.NoError(t, err)
 		client.Close()
 	}
+	_, err = httpd.RemoveUser(user, http.StatusOK)
+	assert.NoError(t, err)
 
 	err = dataprovider.Close()
 	assert.NoError(t, err)
 	providerConf.CheckPasswordScope = 6
 	err = dataprovider.Initialize(providerConf, configDir)
 	assert.NoError(t, err)
+	user, _, err = httpd.AddUser(u, http.StatusOK)
+	assert.NoError(t, err)
+	user.Password = defaultPassword + "1"
 	client, err = getSftpClient(user, usePubKey)
 	if !assert.Error(t, err) {
 		client.Close()