sftpd: fix keyboard interactive test cases

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino 2023-08-04 21:32:14 +02:00
parent 75e6ef6132
commit 132d18d5d1
No known key found for this signature in database
GPG key ID: 935D2952DEC4EECF

View file

@ -393,9 +393,13 @@ func TestInitialization(t *testing.T) {
sftpdConf.KeyboardInteractiveHook = "invalid_file"
err = sftpdConf.Initialize(configDir)
assert.Error(t, err)
sftpdConf.KeyboardInteractiveAuthentication = true
sftpdConf.KeyboardInteractiveHook = filepath.Join(homeBasePath, "invalid_file")
err = sftpdConf.Initialize(configDir)
assert.Error(t, err)
sftpdConf.KeyboardInteractiveAuthentication = false
err = sftpdConf.Initialize(configDir)
assert.Error(t, err)
sftpdConf.Bindings = []sftpd.Binding{
{
Port: 4444,