xref: /freebsd/libexec/nuageinit/tests/addgroup.lua (revision a42d6f76018e4ed8324e319ab48aac904bda437c)
1*a42d6f76SBaptiste Daroussin#!/usr/libexec/flua
2*a42d6f76SBaptiste Daroussin
3*a42d6f76SBaptiste Daroussinlocal n = require("nuage")
4*a42d6f76SBaptiste Daroussinif n.addgroup() then
5*a42d6f76SBaptiste Daroussin	n.err("addgroup should not accept empty value")
6*a42d6f76SBaptiste Daroussinend
7*a42d6f76SBaptiste Daroussinif n.addgroup("plop") then
8*a42d6f76SBaptiste Daroussin	n.err("addgroup should not accept empty value")
9*a42d6f76SBaptiste Daroussinend
10*a42d6f76SBaptiste Daroussinlocal gr = {}
11*a42d6f76SBaptiste Daroussingr.name = "impossible_groupname"
12*a42d6f76SBaptiste Daroussinlocal res = n.addgroup(gr)
13*a42d6f76SBaptiste Daroussinif not res then
14*a42d6f76SBaptiste Daroussin	n.err("valid addgroup should return a path")
15*a42d6f76SBaptiste Daroussinend
16