673c78
#!/bin/bash
673c78
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
673c78
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
673c78
#
673c78
#   runtest.sh of /CoreOS/util-linux/various
673c78
#   Description: This test groups small sanity and regression tests for util-linux
673c78
#   Author: Miroslav Vadkerti <mvadkert@redhat.com>
673c78
#
673c78
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
673c78
#
673c78
#   Copyright (c) 2013 Red Hat, Inc. All rights reserved.
673c78
#
673c78
#   This copyrighted material is made available to anyone wishing
673c78
#   to use, modify, copy, or redistribute it subject to the terms
673c78
#   and conditions of the GNU General Public License version 2.
673c78
#
673c78
#   This program is distributed in the hope that it will be
673c78
#   useful, but WITHOUT ANY WARRANTY; without even the implied
673c78
#   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
673c78
#   PURPOSE. See the GNU General Public License for more details.
673c78
#
673c78
#   You should have received a copy of the GNU General Public
673c78
#   License along with this program; if not, write to the Free
673c78
#   Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
673c78
#   Boston, MA 02110-1301, USA.
673c78
#
673c78
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
673c78
673c78
# Include Beaker environment
673c78
#. /usr/bin/rhts-environment.sh || exit 1
673c78
. /usr/share/beakerlib/beakerlib.sh || exit 1
673c78
673c78
PACKAGE="util-linux"
673c78
673c78
rlJournalStart
673c78
    rlPhaseStartSetup
673c78
        rlAssertRpm $PACKAGE
673c78
    rlPhaseEnd
673c78
673c78
    rlPhaseStartTest "return code of chfn should be always 1 in case failure"
673c78
        rlRun "chfn -f a:b" 1
673c78
        rlRun "chfn -o a:b" 1
673c78
        rlRun "chfn -p a:b" 1
673c78
        rlRun "chfn -h a:b" 1
673c78
        rlRun "chfn -x a:b" 1
673c78
        rlRun "chfn -f a -o b -p c -h d unknown-user" 1
673c78
    rlPhaseEnd
673c78
673c78
    rlPhaseStartCleanup
673c78
    rlPhaseEnd
673c78
rlJournalPrintText
673c78
rlJournalEnd