Skip to content

Commit

Permalink
cukinia: add cukinia_group
Browse files Browse the repository at this point in the history
Signed-off-by: Maciej Pijanowski <maciej.pijanowski@3mdeb.com>
  • Loading branch information
macpijan authored and joufellasfl committed Dec 5, 2019
1 parent 9835ab6 commit 250c54d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -42,6 +42,7 @@ A cukinia config file supports the following statements:
### Test statements

* ``cukinia_user <username>``: Validates that user exists
* ``cukinia_group <groupname>``: Validates that group exists
* ``cukinia_process <pname> [user]``: Validates that process runs (optional user)
* ``cukinia_python_pkg <pkg>``: Validates that Python package is installed
* ``cukinia_test <expr>``: Validates that test(1) expression is true
Expand Down
12 changes: 11 additions & 1 deletion cukinia
Expand Up @@ -20,7 +20,8 @@ GENERIC_FUNCTS='cmd
python_pkg
symlink
test
user'
user
group'

# By default log to stdout
__log_file="/dev/stdout"
Expand Down Expand Up @@ -372,6 +373,15 @@ _cukinia_user()
grep -q "^$user:" /etc/passwd
}

# _cukinia_group: checks if group $1 exists
_cukinia_group()
{
local group="$1"

_cukinia_prepare "Checking group \"$group\""
grep -q "^$group:" /etc/group
}

# cukinia_process: checks if process $pname runs
# Optional: check if the process exist for a given username $puser
# arg: $1: the process name
Expand Down

0 comments on commit 250c54d

Please sign in to comment.