Branch Coverage

lib/Provision/Unix/User/Linux.pm
Criterion Covered Total %
branch 32 84 38.1


line true false branch
67 3 2 unless $user->_is_valid_username($username)
71 0 2 if $p{'gecos'}
72 0 2 if $p{'homedir'}
73 0 2 if $p{'expire'}
74 2 0 if $p{'uid'}
75 0 2 if $p{'shell'}
76 2 0 if $group
79 1 1 if $p{'test_mode'}
80 0 1 unless $util->syscmd($cmd, 'debug', 0, 'fatal', 0)
82 0 1 if ($password)
86 0 0 unless (open $FH, "| $passwd --stdin $username")
94 0 1 unless $self->exists
115 0 2 if ($self->exists_group($p{'group'}))
123 2 0 if $p{'gid'}
146 0 2 unless $user->_is_valid_username($username)
149 1 1 if $p{'test_mode'}
152 0 1 unless ($self->exists)
163 1 0 if -d $homedir and $homedir ne '/tmp'
169 1 0 unless ($self->exists)
204 0 1 unless ($self->exists_group($group))
212 0 1 if $p{'test_mode'}
215 0 1 unless $util->syscmd($cmd, 'debug', $debug, 'fatal', $fatal)
223 1 0 unless ($self->exists_group($group))
234 0 5 unless $user->_is_valid_username($username)
241 5 0 if (-f '/etc/passwd')
243 2 3 unless $exists
252 0 0 unless defined $uid
263 11 0 if (-f '/etc/group')
265 8 3 unless $exists
275 0 0 if (defined $gid)
297 0 0 if ($p{'password'})
323 0 0 unless $self->exists($username)
327 0 0 unless (-f $pass_file)
329 0 0 unless -f $pass_file
334 0 0 unless $entry
339 0 0 if /^$username\:/
341 0 0 unless $util->file_write($pass_file, 'lines', \@lines, 'debug', 0, 'fatal', 0)
344 0 0 if ($p{'ssh_key'})
348 0 0 unless $homedir and -d $homedir
364 0 0 unless -f $nscd
367 0 0 unless $pid
370 0 0 unless -x $nscd