Compare commits
No commits in common. "c8" and "c9s" have entirely different histories.
1
.fmf/version
Normal file
1
.fmf/version
Normal file
@ -0,0 +1 @@
|
||||
1
|
||||
7
.gitignore
vendored
7
.gitignore
vendored
@ -1 +1,6 @@
|
||||
SOURCES/passwd-0.80.autotoolized.tar.bz2
|
||||
/.project
|
||||
passwd-0.78.tar.bz2
|
||||
/passwd-0.78.99.tar.bz2
|
||||
/passwd-0.79.tar.bz2
|
||||
/passwd-0.80.tar.bz2
|
||||
/passwd-0.80.autotoolized.tar.bz2
|
||||
|
||||
@ -1 +0,0 @@
|
||||
fe20d0f7f5786bd098d5986cb6e8e9f395829216 SOURCES/passwd-0.80.autotoolized.tar.bz2
|
||||
2
ci.fmf
Normal file
2
ci.fmf
Normal file
@ -0,0 +1,2 @@
|
||||
# Docs: https://docs.fedoraproject.org/en-US/ci/tmt/#_multiple_plans
|
||||
resultsdb-testcase: separate
|
||||
6
gating.yaml
Normal file
6
gating.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-*
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/all-internal.functional}
|
||||
@ -7,15 +7,14 @@
|
||||
Summary: An utility for setting or changing passwords using PAM
|
||||
Name: passwd
|
||||
Version: 0.80
|
||||
Release: 4%{?dist}
|
||||
Release: 12%{?dist}
|
||||
License: BSD or GPL+
|
||||
Group: System Environment/Base
|
||||
URL: https://pagure.io/passwd
|
||||
Source: https://releases.pagure.org/passwd/passwd-%{version}.autotoolized.tar.bz2
|
||||
Patch0: passwd-0.80-manpage.patch
|
||||
Patch1: passwd-0.80-S-output.patch
|
||||
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
Requires: pam >= 1.0.90, /etc/pam.d/system-auth
|
||||
BuildRequires: make
|
||||
%if %{WITH_SELINUX}
|
||||
Requires: libselinux >= 2.1.6-3
|
||||
BuildRequires: libselinux-devel >= 2.1.6-3
|
||||
@ -25,8 +24,8 @@ BuildRequires: gcc
|
||||
BuildRequires: glib2-devel, libuser-devel, pam-devel, libuser >= 0.53-1
|
||||
BuildRequires: gettext, popt-devel
|
||||
%if %{WITH_AUDIT}
|
||||
BuildRequires: audit-libs-devel >= 1.0.14
|
||||
Requires: audit-libs >= 1.0.14
|
||||
BuildRequires: audit-libs-devel >= 2.4.5
|
||||
Requires: audit-libs >= 2.4.5
|
||||
%endif
|
||||
|
||||
%description
|
||||
@ -68,7 +67,6 @@ done
|
||||
|
||||
|
||||
%files -f %{name}.lang
|
||||
%defattr(-,root,root,-)
|
||||
%{!?_licensedir:%global license %%doc}
|
||||
%license COPYING
|
||||
%doc AUTHORS ChangeLog NEWS
|
||||
@ -77,14 +75,39 @@ done
|
||||
%{_mandir}/man1/passwd.1*
|
||||
|
||||
%changelog
|
||||
* Mon Feb 07 2022 Jiri Kucera <jkucera@redhat.com> - 0.80-4
|
||||
- Rebuild due to migrated tests
|
||||
Related: #1841499
|
||||
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 0.80-12
|
||||
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
|
||||
Related: rhbz#1991688
|
||||
|
||||
* Fri Dec 13 2019 Jiri Kucera <jkucera@redhat.com> - 0.80-3
|
||||
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 0.80-11
|
||||
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
|
||||
|
||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.80-10
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.80-9
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.80-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
* Wed Dec 04 2019 Jiri Kucera <jkucera@redhat.com> - 0.80-7
|
||||
- fix inconsistencies in manpage
|
||||
- fix incorrect -S output
|
||||
Resolves: #1612906, #1740168
|
||||
Resolves: #1612221, #1740166
|
||||
|
||||
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.80-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.80-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.80-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
* Tue Apr 17 2018 Jiri Kucera <jkucera@redhat.com> - 0.80-3
|
||||
- passwd-0.80 relies on AUDIT_ACCT_LOCK and AUDIT_ACCT_UNLOCK that
|
||||
were introduced at audit-2.4.5
|
||||
|
||||
* Thu Apr 12 2018 Jiri Kucera <jkucera@redhat.com> - 0.80-2
|
||||
- Removed autotools dependencies
|
||||
9
plans.fmf
Normal file
9
plans.fmf
Normal file
@ -0,0 +1,9 @@
|
||||
/all-internal:
|
||||
discover:
|
||||
how: fmf
|
||||
url: https://pkgs.devel.redhat.com/git/tests/passwd
|
||||
execute:
|
||||
how: tmt
|
||||
adjust:
|
||||
enabled: false
|
||||
when: distro == centos-stream or distro == fedora
|
||||
1
sources
Normal file
1
sources
Normal file
@ -0,0 +1 @@
|
||||
SHA512 (passwd-0.80.autotoolized.tar.bz2) = a9c557cc4261d565935d6c1ace4a8f59194c9dfc55a9a36db7da16a017a3bdd088ddb10aba905e396e002c8fb13001123f4fda9045141f47238c125fb44a83ed
|
||||
63
tests/changing-password-with-stdin-opiton-limits/Makefile
Normal file
63
tests/changing-password-with-stdin-opiton-limits/Makefile
Normal file
@ -0,0 +1,63 @@
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /CoreOS/passwd/Regression/changing-password-with-stdin-opiton-limits
|
||||
# Description: Test for changing password with --stdin opiton limits
|
||||
# Author: Eva Mrakova <emrakova@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2015 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/CoreOS/passwd/Regression/changing-password-with-stdin-opiton-limits
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Eva Mrakova <emrakova@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: Test for changing password with --stdin opiton limits" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 5m" >> $(METADATA)
|
||||
@echo "RunFor: passwd" >> $(METADATA)
|
||||
@echo "Requires: passwd" >> $(METADATA)
|
||||
@echo "Requires: expect" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2+" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
6
tests/changing-password-with-stdin-opiton-limits/PURPOSE
Normal file
6
tests/changing-password-with-stdin-opiton-limits/PURPOSE
Normal file
@ -0,0 +1,6 @@
|
||||
PURPOSE of /CoreOS/passwd/Regression/changing-password-with-stdin-opiton-limits
|
||||
Description: Test for changing password with --stdin opiton limits 512 bytes long
|
||||
Author: Eva Mrakova <emrakova@redhat.com>
|
||||
Bug summary: changing password with --stdin opiton limits password size to 79 characters
|
||||
|
||||
Tests changing password 511 chars long
|
||||
94
tests/changing-password-with-stdin-opiton-limits/runtest.sh
Normal file
94
tests/changing-password-with-stdin-opiton-limits/runtest.sh
Normal file
@ -0,0 +1,94 @@
|
||||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /CoreOS/passwd/Regression/changing-password-with-stdin-opiton-limits
|
||||
# Description: Test for changing password with --stdin opiton limits
|
||||
# Author: Eva Mrakova <emrakova@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2015 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/bin/rhts-environment.sh || exit 1
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="passwd"
|
||||
|
||||
TSTUSR="testuser"
|
||||
# max length password: 512 chars (supported by pam_unix, PAM_MAX_RESP_SIZE)
|
||||
# such long passwords do not work on RHEL6 for pam <= pam-1.1.1-20.el6
|
||||
# similarly for RHEL7 and pam-1.1.8-12.el7
|
||||
TSTPASSWD=$(tr -dc 'A-Za-z0-9' </dev/urandom | head -c 511)
|
||||
NEWPASSWD=$(tr -dc 'A-Za-z0-9' </dev/urandom | head -c 511)
|
||||
|
||||
function change_passwd {
|
||||
# $1 user, $2 user's password, $3 new user's password
|
||||
expect <<EOF
|
||||
spawn su -c passwd - $1
|
||||
set timeout 3
|
||||
expect "password:"
|
||||
send "$2\r"
|
||||
expect "password:"
|
||||
send "$3\r"
|
||||
expect "password:"
|
||||
send "$3\r"
|
||||
expect "successfully" { exit 0 }
|
||||
exit 2
|
||||
EOF
|
||||
return $?
|
||||
}
|
||||
|
||||
function set_passwd {
|
||||
# $1 user, $2 passwd
|
||||
expect <<EOF
|
||||
spawn passwd $1
|
||||
set timeout 3
|
||||
expect "password:"
|
||||
send "$2\r"
|
||||
expect "password:"
|
||||
send "$2\r"
|
||||
expect "successfully" { exit 0 }
|
||||
exit 2
|
||||
EOF
|
||||
return $?
|
||||
}
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
rlRun "pushd $TmpDir"
|
||||
rlRun "useradd $TSTUSR"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun "set_passwd $TSTUSR $TSTPASSWD" 0 "root: setting password interactively"
|
||||
rlRun "change_passwd $TSTUSR $TSTPASSWD $NEWPASSWD" 0 "user: changing password"
|
||||
rlRun "echo $TSTPASSWD | passwd --stdin $TSTUSR" 0 "root: resetting password via --stdin"
|
||||
rlRun "change_passwd $TSTUSR $TSTPASSWD $NEWPASSWD" 0 "user: changing password"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "userdel -r $TSTUSR"
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
63
tests/passwd-exit-status-1/Makefile
Normal file
63
tests/passwd-exit-status-1/Makefile
Normal file
@ -0,0 +1,63 @@
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /CoreOS/passwd/Regression/passwd-exit-status-1
|
||||
# Description: Test for passwd exit status 1
|
||||
# Author: Ondrej Moris <omoris@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2010 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/CoreOS/passwd/Regression/passwd-exit-status-1
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Ondrej Moris <omoris@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: Test for passwd exit status 1" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 5m" >> $(METADATA)
|
||||
@echo "RunFor: passwd" >> $(METADATA)
|
||||
@echo "Requires: passwd" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
26
tests/passwd-exit-status-1/PURPOSE
Normal file
26
tests/passwd-exit-status-1/PURPOSE
Normal file
@ -0,0 +1,26 @@
|
||||
PURPOSE of /CoreOS/passwd/Regression/passwd-exit-status-1
|
||||
Description: Test for passwd exit status 1
|
||||
Author: Ondrej Moris <omoris@redhat.com>
|
||||
Bug summary: passwd exit status 1
|
||||
|
||||
Description:
|
||||
|
||||
Description of problem:
|
||||
passwd exits with status 1 when argument -S is passed.
|
||||
|
||||
Version-Release number of selected component (if applicable):
|
||||
5.X
|
||||
|
||||
How reproducible:
|
||||
allways
|
||||
|
||||
Steps to Reproduce:
|
||||
1. passwd -S user
|
||||
2. echo $?
|
||||
|
||||
|
||||
Actual results:
|
||||
1
|
||||
|
||||
Expected results:
|
||||
0
|
||||
55
tests/passwd-exit-status-1/runtest.sh
Normal file
55
tests/passwd-exit-status-1/runtest.sh
Normal file
@ -0,0 +1,55 @@
|
||||
#!/bin/bash
|
||||
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /CoreOS/passwd/Regression/passwd-exit-status-1
|
||||
# Description: Test for passwd exit status 1
|
||||
# Author: Ondrej Moris <omoris@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2010 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include rhts environment
|
||||
. /usr/bin/rhts-environment.sh
|
||||
. /usr/share/beakerlib/beakerlib.sh
|
||||
|
||||
PACKAGE="passwd"
|
||||
|
||||
rlJournalStart
|
||||
|
||||
rlPhaseStartSetup
|
||||
|
||||
rlAssertRpm $PACKAGE
|
||||
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
|
||||
rlRun "passwd -S root" 0
|
||||
rlRun "passwd -S nonExistingUser" 1-255
|
||||
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
|
||||
rlJournalEnd
|
||||
65
tests/smoke-test/Makefile
Normal file
65
tests/smoke-test/Makefile
Normal file
@ -0,0 +1,65 @@
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /CoreOS/passwd/Sanity/smoke-test
|
||||
# Description: Test basic functionality.
|
||||
# Author: Ondrej Moris <omoris@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2010 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/CoreOS/passwd/Sanity/smoke-test
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Ondrej Moris <omoris@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: Test basic functionality." >> $(METADATA)
|
||||
@echo "Type: Sanity" >> $(METADATA)
|
||||
@echo "TestTime: 5m" >> $(METADATA)
|
||||
@echo "RunFor: passwd" >> $(METADATA)
|
||||
@echo "Requires: passwd" >> $(METADATA)
|
||||
@echo "Requires: openssh" >> $(METADATA)
|
||||
@echo "Requires: expect" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
5
tests/smoke-test/PURPOSE
Normal file
5
tests/smoke-test/PURPOSE
Normal file
@ -0,0 +1,5 @@
|
||||
PURPOSE of /CoreOS/passwd/Sanity/smoke-test
|
||||
Description: Test basic functionality.
|
||||
Author: Ondrej Moris <omoris@redhat.com>
|
||||
|
||||
tests basic passwd command usage scenarios
|
||||
141
tests/smoke-test/runtest.sh
Normal file
141
tests/smoke-test/runtest.sh
Normal file
@ -0,0 +1,141 @@
|
||||
#!/bin/bash
|
||||
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /CoreOS/passwd/Sanity/smoke-test
|
||||
# Description: Test basic functionality.
|
||||
# Author: Ondrej Moris <omoris@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2010 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include rhts environment
|
||||
. /usr/bin/rhts-environment.sh
|
||||
. /usr/share/beakerlib/beakerlib.sh
|
||||
|
||||
PACKAGE="passwd"
|
||||
|
||||
function set_password {
|
||||
|
||||
expect >/tmp/out 2>&1 <<EOF
|
||||
spawn passwd $1
|
||||
set timeout 3
|
||||
expect "password:"
|
||||
send "$2\r"
|
||||
expect "password:"
|
||||
send "$2\r"
|
||||
expect "successfully" { exit 0 }
|
||||
exit 2
|
||||
EOF
|
||||
|
||||
ret=$?
|
||||
cat /tmp/out
|
||||
return $ret
|
||||
}
|
||||
|
||||
function check_password {
|
||||
|
||||
expect >/tmp/out 2>&1 <<EOF
|
||||
spawn ssh $1@`hostname` echo -n "XYZ" && whoami
|
||||
set timeout 3
|
||||
expect "(yes/no)" { send "yes\r" }
|
||||
expect "password" {
|
||||
send "$2\r"
|
||||
expect "XYZ${1}" { exit 0 }
|
||||
exit 2
|
||||
}
|
||||
exit 3
|
||||
EOF
|
||||
|
||||
ret=$?
|
||||
cat /tmp/out
|
||||
return $ret
|
||||
}
|
||||
|
||||
rlJournalStart
|
||||
|
||||
rlPhaseStartSetup
|
||||
|
||||
I=0
|
||||
while true; do
|
||||
getent passwd t${I} || break
|
||||
I=$[$I+1]
|
||||
done
|
||||
U=t${I}
|
||||
rlRun "useradd $U" 0 "Creating testing account"
|
||||
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
|
||||
rlRun "set_password $U a" 0 "Setting initial password to 'a'"
|
||||
sleep 3
|
||||
rlRun "check_password $U a" 0 "Checking good password"
|
||||
rlRun "check_password $U x" 1-255 "Checking wrong password"
|
||||
rlRun "echo b | passwd --stdin $U" 0 "Changing password via stdin to 'b'"
|
||||
sleep 3
|
||||
rlRun "check_password $U b" 0 "Checking good password"
|
||||
rlRun "check_password $U x" 1-255 "Checking wrong password"
|
||||
rlRun "passwd -l $U" 0 "Locking account"
|
||||
sleep 3
|
||||
rlRun "check_password $U b" 1-255 "Checking good password"
|
||||
rlRun "check_password $U x" 1-255 "Checking wrong password"
|
||||
rlRun "passwd -u $U" 0 "Unlocking account"
|
||||
sleep 3
|
||||
rlRun "check_password $U b" 0 "Checking good password"
|
||||
rlRun "check_password $U x" 1-255 "Checking wrong password"
|
||||
rlRun "passwd -d $U" 0 "Disabling account"
|
||||
sleep 3
|
||||
rlRun "check_password $U b" 1-255 "Checking good password"
|
||||
rlRun "check_password $U x" 1-255 "Checking wrong password"
|
||||
rlRun "passwd -l $U" 0 "Locking account"
|
||||
sleep 3
|
||||
rlRun "check_password $U x" 1-255 "Checking wrong password"
|
||||
rlRun "passwd -u $U > /tmp/out 2>&1" 1-255 "Unlocking account"
|
||||
rlRun "grep \"Unsafe\" /tmp/out" 0 "Checking warning message"
|
||||
rlRun "passwd -uf $U" 0 "Force Unlocking account"
|
||||
sleep 3
|
||||
rlRun "echo c | passwd --stdin $U" 0 "Changing password via stdin to 'c'"
|
||||
sleep 3
|
||||
rlRun "check_password $U c" 0 "Checking good password"
|
||||
rlRun "check_password $U x" 1-255 "Checking wrong password"
|
||||
rlRun "passwd -d $U" 0 "Disabling account"
|
||||
sleep 3
|
||||
rlRun "check_password $U c" 1-255 "Checking good password"
|
||||
rlRun "check_password $U x" 1-255 "Checking wrong password"
|
||||
rlRun "echo d | passwd --stdin $U" 0 "Changing password via stdin to 'd'"
|
||||
sleep 3
|
||||
rlRun "check_password $U d" 0 "Checking good password"
|
||||
rlRun "check_password $U x" 1-255 "Checking wrong password"
|
||||
rlRun "passwd -S $U" 0 "Checking good account information"
|
||||
rlRun "passwd -S nonexistinguser" 1-255 "Checking wrong account information"
|
||||
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
|
||||
rlRun "userdel -r $U" 0 "Removing testing account"
|
||||
rlRun "rm -f /tmp/out" 0 "Removing output file"
|
||||
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
|
||||
rlJournalEnd
|
||||
30
tests/tests.yml
Normal file
30
tests/tests.yml
Normal file
@ -0,0 +1,30 @@
|
||||
---
|
||||
# Tests that run in classic context
|
||||
- hosts: localhost
|
||||
roles:
|
||||
- role: standard-test-beakerlib
|
||||
tags:
|
||||
- classic
|
||||
tests:
|
||||
- changing-password-with-stdin-opiton-limits
|
||||
- passwd-exit-status-1
|
||||
- smoke-test
|
||||
required_packages:
|
||||
- expect
|
||||
- findutils # beakerlib needs find command
|
||||
- openssh # smoke-test needs openssh
|
||||
- passwd
|
||||
|
||||
# Tests that run in container context
|
||||
- hosts: localhost
|
||||
roles:
|
||||
- role: standard-test-beakerlib
|
||||
tags:
|
||||
- container
|
||||
tests:
|
||||
- changing-password-with-stdin-opiton-limits
|
||||
- passwd-exit-status-1
|
||||
required_packages:
|
||||
- expect
|
||||
- findutils # beakerlib needs find command
|
||||
- passwd
|
||||
Loading…
Reference in New Issue
Block a user