Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177749254
D61759.1795194975.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
994 B
Referenced Files
None
Subscribers
None
D61759.1795194975.diff
View Options
Index: libexec/nuageinit/tests/adduser.lua
===================================================================
--- libexec/nuageinit/tests/adduser.lua
+++ libexec/nuageinit/tests/adduser.lua
@@ -15,12 +15,23 @@
n.err("valid adduser should return a path")
end
-pw = {}
-pw.name = "underscore_"
--- Call adduser twice to test both addding and looking up an existing user.
-for i = 1, 2 do
- local res = n.adduser(pw)
- if not res then
- n.err("no path returned for username ending with _")
+local function ends_with(s, suffix)
+ if not s then
+ return false
+ end
+ return suffix == "" or s:sub(-#suffix) == suffix
+end
+
+for _, name in ipairs({"underscore_", "0"}) do
+ pw = {}
+ pw.name = name
+ -- Call adduser twice to test both addding and looking up an existing
+ -- user.
+ for i = 1, 2 do
+ local res = n.adduser(pw)
+ if not ends_with(res, "/" .. name) then
+ n.err("expected .../" .. name .. " for username " ..
+ name .. ", got " .. tostring(res))
+ end
end
end
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 20, 5:16 PM (2 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41872147
Default Alt Text
D61759.1795194975.diff (994 B)
Attached To
Mode
D61759: nuageinit: Add test for user named "0"
Attached
Detach File
Event Timeline