diff --git a/backend/protondrive/security_test.go b/backend/protondrive/security_test.go index 3575684d5..500c41377 100644 --- a/backend/protondrive/security_test.go +++ b/backend/protondrive/security_test.go @@ -684,10 +684,14 @@ func TestPasswordStoredObscured(t *testing.T) { const password, mailboxPassword = "stored-Hunter2-1a2b3c", "stored-mailbox-4d5e6f" srv := protontest.New(t) srv.AddTwoPasswordUser("user", password, mailboxPassword) - oldPath := config.GetConfigPath() + oldPath, oldData := config.GetConfigPath(), config.Data() path := filepath.Join(t.TempDir(), "rclone.conf") require.NoError(t, config.SetConfigPath(path)) - t.Cleanup(func() { _ = config.SetConfigPath(oldPath) }) + t.Cleanup(func() { + assert.NoError(t, config.SetConfigPath(oldPath)) + config.SetData(oldData) + assert.True(t, config.Data() == oldData, "the config storage isn't restored") + }) configfile.Install() // As "rclone config create obscured protondrive ... --obscure".