turbo-getgroup: the primary users should not be returned
This commit is contained in:
parent
2cdc2ae6c6
commit
de1ab2d0d1
@ -270,7 +270,7 @@ pub fn testCorpus(allocator: Allocator) !Corpus {
|
||||
allocator,
|
||||
100000,
|
||||
"service-account",
|
||||
&[_][]const u8{ "svc-bar", "vidmantas" },
|
||||
&[_][]const u8{ "svc-bar", "vidmantas", "root" },
|
||||
);
|
||||
defer group0.deinit(allocator);
|
||||
defer group1.deinit(allocator);
|
||||
|
@ -249,3 +249,33 @@ test "turbo-getent passwd_all" {
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
|
||||
test "turbo-getent group" {
|
||||
var tf = try File.TestDB.init(testing.allocator);
|
||||
defer tf.deinit();
|
||||
var stdout = ArrayList(u8).init(testing.allocator);
|
||||
defer stdout.deinit();
|
||||
var stderr = ArrayList(u8).init(testing.allocator);
|
||||
defer stderr.deinit();
|
||||
|
||||
{
|
||||
const args = &[_][*:0]const u8{
|
||||
"--db",
|
||||
tf.path,
|
||||
"group",
|
||||
"root",
|
||||
"doesnotexist",
|
||||
"svc-bar",
|
||||
"0",
|
||||
"1",
|
||||
};
|
||||
const got = execute(stdout.writer(), stderr.writer(), args);
|
||||
try testing.expectEqual(got, 2);
|
||||
const want =
|
||||
\\root:x:0:
|
||||
\\svc-bar:x:128:root,vidmantas
|
||||
\\
|
||||
;
|
||||
try testing.expectEqualStrings(want, stdout.items);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user