Skip to content

Commit e010dd8

Browse files
committed
chore: prove init resets stale ids in the unknown-user test
1 parent 7691f22 commit e010dd8

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

plugin_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ func TestInitUnknownUser(t *testing.T) {
132132
preparedEnvs: make([]string, 0),
133133
cfg: &Config{},
134134
log: log,
135+
// pre-populate so the assertions below prove Init resets the stale ids
136+
ids: &ids{uid: 7, gid: 7},
135137
}
136138

137139
v := viper.New()
@@ -143,7 +145,7 @@ func TestInitUnknownUser(t *testing.T) {
143145

144146
err = p.Init(cfg, NewTestLogger(log))
145147
require.Error(t, err)
146-
// the failed resolution must leave the ids unset, reading as 0/0
148+
// the failed resolution must reset the stale ids, reading as 0/0
147149
require.Equal(t, 0, p.UID())
148150
require.Equal(t, 0, p.GID())
149151
}

0 commit comments

Comments
 (0)