#! /usr/bin/perl -Idebian/tests/lib


use diagnostics;
use strict;
use warnings;

my $name='duq';

use AdduserTestsCommon;
use Test::More;

my $cl_user = AdduserTestsCommon::AdduserTestCleanup->new(
    \&cleanup_user
);

assert_user_does_not_exist($name);
$cl_user->add($name);
assert_command_success(
    '/usr/sbin/adduser',
    '--stdoutmsglevel=error', '--stderrmsglevel=error',
    '--system',
    $name
);
assert_user_exists($name);

my $output = `/usr/sbin/deluser --stdoutmsglevel=error --stderrmsglevel=error $name 2>&1`;
is($output, '', 'option "--stdoutmsglevel=error" silences deluser output under normal use');

assert_user_does_not_exist($name);
$cl_user->finalize();

done_testing();

# vim: tabstop=4 shiftwidth=4 expandtab
