Skip to content

Commit 0297c1a

Browse files
author
Aaron
committed
Create motd test for regular user with MESSAGE param
1 parent a27433e commit 0297c1a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

host_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@ func TestMotdCommand(t *testing.T) {
176176
t.Error("failed to print MOTD using /motd with no parameters", "actual:", actual, "expected:", expected)
177177
}
178178

179+
// Test as regular user - expected behaviour: should return an error
180+
w.Write([]byte("/motd foobarbaz\r\n"))
181+
if strings.Compare(host.motd, "foobar") != 0 {
182+
t.Error("failed to hinder non-OPs to modify the MOTD")
183+
}
179184
return nil
180185
})
181186
}

0 commit comments

Comments
 (0)