Compare commits

..

27 commits

Author SHA1 Message Date
Fedora Release Engineering
72283503de dist-git conversion 2010-07-28 18:16:58 +00:00
Michael Stone
8f22aa3b24 - Tell our agetty to login with /bin/bash now that we're locking the root
account
2008-04-01 16:44:35 +00:00
Michael Stone
fa67d76bb5 - Correct Bernie's '--pauselogin' typo
- Depend on a more specific version of mingetty supporting --loginpause
2008-01-11 08:06:52 +00:00
Bernie Innocenti
348e691881 Bump revision 2008-01-10 05:34:28 +00:00
Bernie Innocenti
ef86a1a774 - dlo#5879, dlo#5705, dlo#5537, dlo#5058: Automatic root login in the
console
2008-01-10 05:29:58 +00:00
Bernie Innocenti
7ab894a1d0 Oops :-) 2008-01-02 13:19:46 +00:00
Bernie Innocenti
6a6ff54cf6 8.54.1-14.olpc2 2008-01-02 13:00:03 +00:00
Bernie Innocenti
093fc07fba Add cpio, finutils for stateless 2008-01-02 12:41:58 +00:00
Bernie Innocenti
19657cadae - Update dependencies
- Happy holidays!
2007-12-26 02:55:47 +00:00
Bernie Innocenti
86b211317a - Re-enable olpc-dm respawn due to popular demand 2007-11-01 11:14:43 +00:00
Bernie Innocenti
797d275ff0 Bump revision 2007-10-15 21:54:36 +00:00
Bernie Innocenti
25e6403411 - Require olpc-utils for olpc-dm
- olpc-dm now lives in /usr/sbin
2007-10-15 21:46:53 +00:00
Bernie Innocenti
92da2bd673 - Drop olpc-dm: it is now in olpc-dm. 2007-10-15 19:07:57 +00:00
Bernie Innocenti
167c1e2e4a - Don't bind-mount /home/olpc/.Xauthority: unbreaks alternate boot 2007-10-13 01:29:52 +00:00
C. Scott Ananian
49a9e7a628 Add missing spec changelog entry. 2007-10-01 20:57:04 +00:00
C. Scott Ananian
6efc69b65d OLPC-specific improvements:
Improve Makefile so that we don't install the original versions of patched
    files in /etc/rc.d and /etc/sysconfig.
Split "readonly rootfs / tmpfs" parts of olpc patch into new 'readonly'
    patch; plus add additional support for preserving changes to /etc/ssh,
    /etc/sysconfig/i18n, /etc/timezone, /var/lib/dbus/machine-id, and
    /var/lib/random-seed.
Add "pretty boot" support: bring up localhost before rhgb-client is
    invoked; some additional calls to rhgb-client; move setsysfont from
    rc.sysinit to z-boot-anim-stop (after animation has finished and DCON
    is frozen); make sure that we cleanly exit pretty boot if interactive
    boot mode is invoked.
2007-10-01 20:42:58 +00:00
John (J5) Palmieri
441ec69380 - don't crash if /etc/sysconfig/i18n does not exist 2007-09-18 15:33:15 +00:00
John (J5) Palmieri
1f7f0dd5e8 - fix crasher bug in olpc-dm 2007-09-13 17:38:58 +00:00
John (J5) Palmieri
1e432894f7 - clean up olpc-dm
- make sure olpc-dm sources /etc/sysconfig/i18n
- add an olpc-login pam control file to avoid unneeded checks
2007-09-11 22:35:50 +00:00
John (J5) Palmieri
b647a05773 - remove /etc/mtab and /etc/fstab from /etc/rwtab 2007-08-30 22:37:18 +00:00
John (J5) Palmieri
4a305578ea - update the olpc patch to include /home/olpc/.Xauthority in rwtab 2007-08-20 20:17:09 +00:00
John (J5) Palmieri
a981533092 - add BR on pam-devel 2007-08-13 21:48:54 +00:00
John (J5) Palmieri
5f7e20b450 - don't print out tty in olpc-dm anymore 2007-08-13 19:49:37 +00:00
John (J5) Palmieri
d2357a5c59 - fix rwtab to not have resolv.conf which screws up NetworkManager 2007-08-13 19:43:42 +00:00
John (J5) Palmieri
b1a6a3729b - branch and optimize for olpc
- add olpc-dm the new display manager for olpc
- don't start netfs, network or netconsole anymore
2007-08-09 21:26:12 +00:00
Tom Callaway
05788534bc Initialize branch OLPC-2 for initscripts 2007-08-08 20:22:41 +00:00
Bill Nottingham
b8712a0f91 8.54.1-1
Resolves: bug #245595
2007-06-25 16:51:17 +00:00
15 changed files with 487 additions and 2387 deletions

66
.gitignore vendored
View file

@ -1,65 +1 @@
/initscripts-9.43.tar.bz2
/initscripts-9.44.tar.bz2
/initscripts-9.45.tar.bz2
/initscripts-9.46.tar.bz2
/initscripts-9.47.tar.bz2
/initscripts-9.48.tar.bz2
/initscripts-9.50.tar.bz2
/initscripts-9.51.tar.bz2
/initscripts-9.52.tar.bz2
/initscripts-9.53.tar.bz2
/initscripts-9.54.tar.bz2
/initscripts-9.55.tar.bz2
/initscripts-9.56.1.tar.bz2
/initscripts-9.58.tar.bz2
/initscripts-9.59.tar.bz2
/initscripts-9.60.tar.bz2
/initscripts-9.61.tar.bz2
/initscripts-9.62.tar.bz2
/initscripts-9.63.tar.bz2
/initscripts-9.64.tar.bz2
/initscripts-9.65.tar.bz2
/initscripts-9.66.tar.bz2
/initscripts-9.67.tar.bz2
/initscripts-9.68.tar.bz2
/initscripts-9.69.tar.bz2
/initscripts-9.70.tar.gz
/initscripts-9.71.tar.gz
/initscripts-9.72.tar.gz
/initscripts-9.74.tar.gz
/initscripts-9.75.tar.gz
/initscripts-9.76.tar.gz
/initscripts-9.77.tar.gz
/initscripts-9.78.tar.gz
/initscripts-9.79.tar.gz
/initscripts-9.80.tar.gz
/initscripts-9.81.tar.gz
/initscripts-9.82.tar.gz
/initscripts-9.83.tar.gz
/initscripts-10.00.tar.gz
/initscripts-10.01.tar.gz
/initscripts-10.02.tar.gz
/initscripts-10.03.tar.gz
/initscripts-10.04.tar.gz
/initscripts-10.05.tar.gz
/initscripts-10.06.tar.gz
/initscripts-10.07.tar.gz
/initscripts-10.08.tar.gz
/initscripts-10.09.tar.gz
/initscripts-10.10.tar.gz
/initscripts-10.11.tar.gz
/initscripts-10.12.tar.gz
/initscripts-10.13.tar.gz
/initscripts-10.14.tar.gz
/initscripts-10.15.tar.gz
/initscripts-10.16.tar.gz
/initscripts-10.17.tar.gz
/initscripts-10.18.tar.gz
/initscripts-10.19.tar.gz
/initscripts-10.20.tar.gz
/initscripts-10.21.tar.gz
/initscripts-10.23.tar.gz
/initscripts-10.24.tar.gz
/initscripts-10.25.tar.gz
/initscripts-10.26.tar.gz
/initscripts-10.27.tar.gz
initscripts-8.54.1.tar.bz2

View file

@ -1,3 +0,0 @@
# Additional information
Check upstream's [README.md](https://github.com/fedora-sysv/initscripts/blob/master/README.md) for more info.

View file

@ -0,0 +1,26 @@
diff -up initscripts-8.54.1/Makefile.dont-install-orig initscripts-8.54.1/Makefile
--- initscripts-8.54.1/Makefile.dont-install-orig 2006-11-28 18:58:26.000000000 -0500
+++ initscripts-8.54.1/Makefile 2007-09-27 15:01:47.000000000 -0400
@@ -39,7 +39,12 @@ install:
mkdir -p $(ROOT)/etc/X11
install -m755 prefdm $(ROOT)/etc/X11/prefdm
- cp -af rc.d sysconfig ppp udev $(ROOT)/etc
+ install -m755 -d $(ROOT)/etc/rc.d $(ROOT)/etc/sysconfig
+ install -m755 rc.d/rc rc.d/rc.local rc.d/rc.sysinit $(ROOT)/etc/rc.d/
+ cp -af rc.d/init.d $(ROOT)/etc/rc.d/
+ install -m755 sysconfig/init sysconfig/netconsole sysconfig/readonly-root $(ROOT)/etc/sysconfig/
+ cp -af sysconfig/network-scripts $(ROOT)/etc/sysconfig/
+ cp -af ppp udev $(ROOT)/etc
mkdir -p $(ROOT)/etc/ppp/peers
chmod 755 $(ROOT)/etc/rc.d/* $(ROOT)/etc/rc.d/init.d/*
chmod 755 $(ROOT)/etc/ppp/peers
@@ -60,8 +65,6 @@ install:
mkdir -p $(ROOT)/etc/sysconfig/console
if uname -m | grep -q s390 ; then \
install -m644 sysconfig/init.s390 $(ROOT)/etc/sysconfig/init ; \
- else \
- rm -f $(ROOT)/etc/sysconfig/init.s390 ; \
fi
mv $(ROOT)/etc/sysconfig/network-scripts/ifup $(ROOT)/sbin

View file

@ -0,0 +1,27 @@
diff -up initscripts-8.54.1/inittab.olpc initscripts-8.54.1/inittab
--- initscripts-8.54.1/inittab.olpc 2006-10-12 13:51:04.000000000 -0400
+++ initscripts-8.54.1/inittab 2007-09-13 13:31:32.000000000 -0400
@@ -15,7 +15,7 @@
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
#
-id:3:initdefault:
+id:5:initdefault:
# System initialization.
si::sysinit:/etc/rc.d/rc.sysinit
@@ -44,10 +44,7 @@ pr:12345:powerokwait:/sbin/shutdown -c "
# Run gettys in standard runlevels
-1:2345:respawn:/sbin/mingetty tty1
-2:2345:respawn:/sbin/mingetty tty2
-3:2345:respawn:/sbin/mingetty tty3
-4:2345:respawn:/sbin/mingetty tty4
-5:2345:respawn:/sbin/mingetty tty5
-6:2345:respawn:/sbin/mingetty tty6
+1:2345:respawn:/sbin/mingetty --loginpause --autologin root --noclear tty1
+2:2345:respawn:/sbin/mingetty --loginpause --autologin root --noclear tty2
+3:2345:respawn:/sbin/agetty -l /bin/bash -w -n ttyS0 115200 vt100
# Run xdm in runlevel 5
-x:5:respawn:/etc/X11/prefdm -nodaemon
+x:5:respawn:/usr/sbin/olpc-dm

View file

@ -0,0 +1,58 @@
diff -up initscripts-8.54.1/rc.d/rc.sysinit.prettyboot initscripts-8.54.1/rc.d/rc.sysinit
--- initscripts-8.54.1/rc.d/rc.sysinit.prettyboot 2007-05-08 08:21:47.000000000 -0400
+++ initscripts-8.54.1/rc.d/rc.sysinit 2007-09-27 14:40:46.000000000 -0400
@@ -11,6 +11,14 @@ unamer=`uname -r`
set -m
+if [ -x /usr/bin/rhgb-client ] ; then
+ # OLPC's rhgb-client depends on localhost being up
+ /sbin/ip addr add 127.0.0.1/8 dev lo
+ /sbin/ip addr add ::1/128 dev lo
+ /sbin/ip link set lo up
+ /usr/bin/rhgb-client --update=sysinit-top # early "we're alive" indication
+fi
+
if [ -f /etc/sysconfig/network ]; then
. /etc/sysconfig/network
fi
@@ -228,9 +236,10 @@ init_crypto() {
return $ret
}
-if [ -x /sbin/setsysfont -a -c /dev/tty1 ]; then
- /sbin/setsysfont < /dev/tty1 > /dev/tty1 2>/dev/null
-fi
+# OLPC does the setsysfont later, in z-boot-anim-stop after DCON is frozen.
+#if [ -x /sbin/setsysfont -a -c /dev/tty1 ]; then
+# /sbin/setsysfont < /dev/tty1 > /dev/tty1 2>/dev/null
+#fi
# Print a text banner.
echo -en $"\t\tWelcome to "
@@ -327,10 +336,13 @@ if [ -x /bin/taskset ]; then
fi
fi
+update_boot_stage udev
+( sleep 3 ; update_boot_stage udev_mid ) &
nashpid=$(pidof nash 2>/dev/null)
[ -n "$nashpid" ] && kill $nashpid >/dev/null 2>&1
unset nashpid
/sbin/start_udev
+update_boot_stage udev_post
# Load other user-defined modules
for file in /etc/sysconfig/modules/*.modules ; do
diff -up initscripts-8.54.1/rc.d/rc.prettyboot initscripts-8.54.1/rc.d/rc
--- initscripts-8.54.1/rc.d/rc.prettyboot 2007-09-27 14:38:55.000000000 -0400
+++ initscripts-8.54.1/rc.d/rc 2007-09-27 14:40:10.000000000 -0400
@@ -31,6 +31,8 @@ export runlevel previous
if [ "$previous" = "N" ]; then
if [ -f /var/run/confirm ]; then
echo $"Entering interactive startup"
+ # bail out of pretty boot
+ chvt 1
else
echo $"Entering non-interactive startup"
fi

View file

@ -0,0 +1,46 @@
diff -up initscripts-8.54.1/rwtab.readonly initscripts-8.54.1/rwtab
--- initscripts-8.54.1/rwtab.readonly 2007-04-13 18:44:55.000000000 -0400
+++ initscripts-8.54.1/rwtab 2007-09-27 13:57:37.000000000 -0400
@@ -24,10 +24,7 @@ empty /var/tux
empty /media
files /etc/adjtime
-files /etc/fstab
-files /etc/mtab
files /etc/ntp.conf
-files /etc/resolv.conf
files /etc/lvm/.cache
files /etc/lvm/archive
files /etc/lvm/backup
diff -up initscripts-8.54.1/statetab.readonly initscripts-8.54.1/statetab
--- initscripts-8.54.1/statetab.readonly 2006-10-27 13:02:22.000000000 -0400
+++ initscripts-8.54.1/statetab 2007-09-27 14:20:11.000000000 -0400
@@ -10,3 +10,8 @@
# /etc/ssh
# /var/spool/mail
#
+/etc/ssh
+/etc/sysconfig/i18n
+/etc/timezone
+/var/lib/dbus
+/var/lib/random-seed
diff -up initscripts-8.54.1/sysconfig/readonly-root.readonly initscripts-8.54.1/sysconfig/readonly-root
--- initscripts-8.54.1/sysconfig/readonly-root.readonly 2007-04-13 18:48:20.000000000 -0400
+++ initscripts-8.54.1/sysconfig/readonly-root 2007-09-27 14:17:39.000000000 -0400
@@ -2,7 +2,7 @@
READONLY=no
# Set to 'yes' to mount various temporary state as either tmpfs
# or on the block device labelled RW_LABEL. Implied by READONLY
-TEMPORARY_STATE=no
+TEMPORARY_STATE=yes
# Place to put a tmpfs for temporary scratch writable space
RW_MOUNT=/var/lib/stateless/writable
# Label on local filesystem which can be used for temporary scratch space
@@ -12,6 +12,6 @@ RW_OPTIONS=
# Label for partition with persistent data
STATE_LABEL=stateless-state
# Where to mount to the persistent data
-STATE_MOUNT=/var/lib/stateless/state
+STATE_MOUNT=/security/state
# Options to use for peristent mount
STATE_OPTIONS=

File diff suppressed because it is too large Load diff

11
olpc-login Normal file
View file

@ -0,0 +1,11 @@
#%PAM-1.0
auth required pam_env.so
auth required pam_permit.so
account required pam_nologin.so
account include system-auth
password include system-auth
session optional pam_keyinit.so force revoke
session include system-auth
session required pam_loginuid.so
session optional pam_console.so

View file

@ -1,29 +0,0 @@
#!/bin/bash
# We always do a rebase to new upstream's tarball for Fedora Rawhide.
#
# For non-Rawhide Fedora releases, we can sometimes backport specific patches,
# if the rebase is not possible.
#
# This scripts automates this process.
# Since we are operating in a dist-git repository where we can't fix things with
# --force-push if something goes wrong, we need to be extra careful and exit
# immediately if something fails.
set -e
curl https://raw.githubusercontent.com/fedora-sysv/initscripts/master/initscripts.spec -o initscripts.spec || exit 1
spectool -g initscripts.spec
# Make a local scratch build in mock first. If it fails, do not upload new tarball!
# srpm_file="$(basename $(fedpkg srpm | grep -i "wrote" | cut -d ':' -f 2))"
# arch="$(uname -p)"
# mock -r "fedora-rawhide-${arch}" "${srpm_file}" || exit 2
# Scratch build passed, the build should pass in Koji as well. Let's proceed:
fedpkg new-sources "$(basename $(spectool -S -l initscripts.spec | gawk '{print $2;}'))" || exit 3
git add initscripts.spec
git commit -m "$(grep Version initscripts.spec | gawk '{print $2;}')"
git show

View file

@ -1 +1 @@
SHA512 (initscripts-10.27.tar.gz) = 951f88158eaf7409f7d65c9875c9ba2611e6a805c17112ddbb34167a1638d87d2433c3962d20e66564669f3424dd7be1265cbe03a1a7d6b1c5413ed43d80148d
c1b2f090197c6c391f0233a6089b9dcd initscripts-8.54.1.tar.bz2

View file

@ -1,64 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /CoreOS/initscripts/Sanity/init-scripts-LSB
# Description: Init scripts should meet LSB specifications
# Author: Yulia Kopkova <ykopkova@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2009 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/initscripts/Sanity/init-scripts-LSB
export TESTVERSION=1.4
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: Jan Scotka <jscotka@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Init scripts should meet LSB specifications" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 5m" >> $(METADATA)
@echo "RunFor: initscripts" >> $(METADATA)
@echo "Requires: initscripts" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: RedHatEnterpriseLinux6" >> $(METADATA)
rhts-lint $(METADATA)

View file

@ -1,3 +0,0 @@
PURPOSE of /CoreOS/initscripts/Sanity/init-scripts-LSB
Description: Init scripts should meet LSB specifications
Author: Yulia Kopkova <ykopkova@redhat.com>

View file

@ -1,228 +0,0 @@
#!/bin/bash
# vim: dict=/usr/share/rhts-library/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/initscripts/Sanity/init-scripts-LSB
# Description: Init scripts should meet LSB specifications
# Author: Jan Scotka <jscotka@redhat.com>, Yulia Kopkova <ykopkova@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2009 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/rhts-library/rhtslib.sh
PACKAGE="initscripts"
SRV_NETCONSOLE=netconsole
SRV_NETFS=netfs
TRG_REMOTEFS=remote-fs.target
SRV_NETWORK=network
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun "useradd testuserqa" 0 "Add test user"
rlFileBackup /etc/sysconfig/netconsole
if rlIsRHEL '<7'; then #there is no syslog in rhel7 and highier
rlRun "sed -i -e 's,^# SYSLOGADDR=,SYSLOGADDR=redhat.com,' /etc/sysconfig/netconsole" 0 "Set remote syslog server address /etc/sysconfig/netconsole"
fi
rlPhaseEnd
rlPhaseStartTest "netconsole service LSB compliance test"
if ls /lib*/modules/*/kernel/drivers/net/netconsole.ko*; then
rlRun "ls /lib*/modules/*/kernel/drivers/net/netconsole.ko*" 0
if rlIsRHEL '<7'; then
SERVICE=$SRV_NETCONSOLE
rlServiceStop $SERVICE
rlLog ">>>>>>>>> service start"
rlRun "service $SERVICE start" 0 " Service must start without problem "
rlRun "service $SERVICE status" 0 " Then Status command "
rlRun "service $SERVICE start" 0 " Already started service "
rlRun "service $SERVICE status" 0 " Again status command "
rlLog ">>>>>>>>> service restart"
rlRun "service $SERVICE restart" 0 " Restarting of service "
rlRun "service $SERVICE status" 0 " Status command "
rlLog ">>>>>>>>> service stop"
rlRun "service $SERVICE stop" 0 " Stopping service "
rlRun "service $SERVICE status" 3 " Status of stopped service "
rlRun "service $SERVICE stop" 0 " Stopping service again "
rlRun "service $SERVICE status" 3 " Status of stopped service "
rlLog ">>>>>>>>> insufficient rights"
rlRun "service $SERVICE start " 0 " Starting service for restarting under nonpriv user "
rlRun "su testuserqa -c 'service $SERVICE restart'" 1 "Insufficient rights, restarting resrvice under nonprivileged user must fail "
rlLog ">>>>>>>>> operations"
rlServiceStop $SERVICE
rlRun "service $SERVICE start" 0 " Service have to implement start function "
rlRun "service $SERVICE restart" 0 " Service have to implement restart function "
rlRun "service $SERVICE status" 0 " Service have to implement status function "
rlRun "service $SERVICE condrestart" 0 " Service have to implement condrestart function "
rlRun "service $SERVICE reload" 0 " Service have to implement reload function "
rlRun "service $SERVICE force-reload" 0 " Service have to implement force-reload function "
rlLog ">>>>>>>>> nonexist operations"
rlRun "service $SERVICE noexistop" 2 " Testing proper return code when nonexisting function "
rlServiceRestore $SERVICE
fi # rhel 6 or less
else
rlLog ">>>> no netconsole kernel module appear here"
rlRun "ls /lib*/modules/*/kernel/drivers/net/netconsole.ko*" 1,2
fi
rlLog "NIC should support polling, NETPOLL should be compliled in kernel and netconsole module should be loaded"
rlLog "`cat /usr/src/kernels/$(uname -r)/.config | grep -i poll`"
rlLog "netconsole module: `lsmod | grep -i netconsole && echo true || echo false`"
rlLog "`cat /var/log/messages | grep -i netconsole | tail -n 10`"
rlPhaseEnd
# for RHEL6 and lower
if rlIsRHEL '<7'; then
rlPhaseStartTest "netfs service LSB compliance test"
SERVICE=$SRV_NETFS
rlServiceStop $SERVICE
rlLog ">>>>>>>>> service start"
rlRun "service $SERVICE start" 0 " Service must start without problem "
rlRun "service $SERVICE status" 0 " Then Status command "
rlRun "service $SERVICE start" 0 " Already started service "
rlRun "service $SERVICE status" 0 " Again status command "
rlLog ">>>>>>>>> service restart"
rlRun "service $SERVICE restart" 0 " Restarting of service "
rlRun "service $SERVICE status" 0 " Status command "
rlLog ">>>>>>>>> service stop"
rlRun "service $SERVICE stop" 0 " Stopping service "
rlRun "service $SERVICE status" 3 " Status of stopped service "
rlRun "service $SERVICE stop" 0 " Stopping service again "
rlRun "service $SERVICE status" 3 " Status of stopped service "
rlLog ">>>>>>>>> insufficient rights"
rlRun "service $SERVICE start " 0 " Starting service for restarting under nonpriv user "
rlRun "su testuserqa -c 'service $SERVICE restart'" 4 "Insufficient rights, restarting resrvice under nonprivileged user must fail "
rlLog ">>>>>>>>> operations"
rlServiceStop $SERVICE
rlRun "service $SERVICE start" 0 " Service have to implement start function "
rlRun "service $SERVICE restart" 0 " Service have to implement restart function "
rlRun "service $SERVICE status" 0 " Service have to implement status function "
rlLog ">>>>>>>>> nonexist operations"
rlRun "service $SERVICE noexistop" 2 " Testing proper return code when nonexisting function "
rlServiceRestore $SERVICE
rlPhaseEnd
else
rlPhaseStartTest "remote-fs target LSB compliance test"
TARGET=$TRG_REMOTEFS
rlServiceStop $TARGET
rlLog ">>>>>>>>> target start"
rlRun "service $TARGET start" 0 " Target must start without problem "
rlRun "service $TARGET status" 0 " Then Status command "
rlRun "service $TARGET start" 0 " Already started target "
rlRun "service $TARGET status" 0 " Again status command "
rlLog ">>>>>>>>> target restart"
rlRun "service $TARGET restart" 0 " Restarting target "
rlRun "service $TARGET status" 0 " Status command "
rlLog ">>>>>>>>> target stop"
rlRun "service $TARGET stop" 0 " Stopping target "
rlRun "service $TARGET status" 3 " Status of stopped target "
rlRun "service $TARGET stop" 0 " Stopping target again "
rlRun "service $TARGET status" 3 " Status of stopped target "
rlLog ">>>>>>>>> insufficient rights"
rlRun "service $TARGET start " 0 " Starting target for restarting under nonpriv user "
rlRun "su testuserqa -c 'service $TARGET restart'" 1 " Insufficient rights, restarting target under nonprivileged user must fail " # returns 1 instead of 4 because of polkit
rlLog ">>>>>>>>> operations"
rlServiceStop $TARGET
rlRun "service $TARGET start" 0 " Target have to implement start function "
rlRun "service $TARGET restart" 0 " Target have to implement restart function "
rlRun "service $TARGET status" 0 " Target have to implement status function "
rlLog ">>>>>>>>> nonexist operations"
rlRun "service $TARGET noexistop" 2 " Testing proper return code when nonexisting function "
rlServiceRestore $TARGET
rlPhaseEnd
fi
# rlPhaseStartTest "$SRV_NETWORK service LSB compliance test"
#
# SERVICE=$SRV_NETWORK
# rlServiceStop $SERVICE
# rlLog ">>>>>>>>> service start"
# rlRun "service $SERVICE start" 0 " Service must start without problem "
# rlRun "service $SERVICE status" 0 " Then Status command "
# rlRun "service $SERVICE start" 1,0 " Already started service "
# rlRun "service $SERVICE status" 0 " Again status command "
# rlLog ">>>>>>>>> service restart"
# rlRun "service $SERVICE restart" 0 " Restarting of service "
# rlRun "service $SERVICE status" 0 " Status command "
# rlLog ">>>>>>>>> service stop"
# rlRun "service $SERVICE stop" 0 " Stopping service "
# rlRun "service $SERVICE status" 0 " Status of stopped service "
# rlRun "service $SERVICE stop" 0 " Stopping service again "
# rlRun "service $SERVICE status" 0 " Status of stopped service "
# rlLog ">>>>>>>>> insufficient rights"
# rlRun "service $SERVICE start " 0 " Starting service for restarting under nonpriv user "
# rlRun "su testuserqa -c 'service $SERVICE restart'" 4 "Insufficient rights, restarting resrvice under nonprivileged user must fail "
# rlLog ">>>>>>>>> operations"
# rlServiceStop $SERVICE
# rlRun "service $SERVICE start" 0 " Service have to implement start function "
# rlRun "service $SERVICE restart" 0 " Service have to implement restart function "
# rlRun "service $SERVICE status" 0 " Service have to implement status function "
# rlRun "service $SERVICE reload" 0 " Service have to implement reload function "
# rlRun "service $SERVICE force-reload" 0 " Service have to implement force-reload function "
# rlLog ">>>>>>>>> nonexist operations"
# rlRun "service $SERVICE noexistop" 2 " Testing proper return code when nonexisting function "
# rlServiceRestore $SERVICE
# service $SERVICE start
rlPhaseEnd
rlPhaseStartCleanup
rlRun "userdel -fr testuserqa" 0 "Remove test user"
rlFileRestore
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -1,291 +0,0 @@
#!/usr/bin/env python
import argparse
import errno
import json
import os
import shutil
import shlex
import signal
import socket
import subprocess
import sys
import tempfile
import time
import distutils.util
IDENTITY = """
-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEA1DrTSXQRF8isQQfPfK3U+eFC4zBrjur+Iy15kbHUYUeSHf5S
jXPYbHYqD1lHj4GJajC9okle9rykKFYZMmJKXLI6987wZ8vfucXo9/kwS6BDAJto
ZpZSj5sWCQ1PI0Ce8CbkazlTp5NIkjRfhXGP8mkNKMEhdNjaYceO49ilnNCIxhpb
eH5dH5hybmQQNmnzf+CGCCLBFmc4g3sFbWhI1ldyJzES5ZX3ahjJZYRUfnndoUM/
TzdkHGqZhL1EeFAsv5iV65HuYbchch4vBAn8jDMmHh8G1ixUCL3uAlosfarZLLyo
3HrZ8U/llq7rXa93PXHyI/3NL/2YP3OMxE8baQIDAQABAoIBAQCxuOUwkKqzsQ9W
kdTWArfj3RhnKigYEX9qM+2m7TT9lbKtvUiiPc2R3k4QdmIvsXlCXLigyzJkCsqp
IJiPEbJV98bbuAan1Rlv92TFK36fBgC15G5D4kQXD/ce828/BSFT2C3WALamEPdn
v8Xx+Ixjokcrxrdeoy4VTcjB0q21J4C2wKP1wEPeMJnuTcySiWQBdAECCbeZ4Vsj
cmRdcvL6z8fedRPtDW7oec+IPkYoyXPktVt8WsQPYkwEVN4hZVBneJPCcuhikYkp
T3WGmPV0MxhUvCZ6hSG8D2mscZXRq3itXVlKJsUWfIHaAIgGomWrPuqC23rOYCdT
5oSZmTvFAoGBAPs1FbbxDDd1fx1hisfXHFasV/sycT6ggP/eUXpBYCqVdxPQvqcA
ktplm5j04dnaQJdHZ8TPlwtL+xlWhmhFhlCFPtVpU1HzIBkp6DkSmmu0gvA/i07Z
pzo5Z+HRZFzruTQx6NjDtvWwiXVLwmZn2oiLeM9xSqPu55OpITifEWNjAoGBANhH
XwV6IvnbUWojs7uiSGsXuJOdB1YCJ+UF6xu8CqdbimaVakemVO02+cgbE6jzpUpo
krbDKOle4fIbUYHPeyB0NMidpDxTAPCGmiJz7BCS1fCxkzRgC+TICjmk5zpaD2md
HCrtzIeHNVpTE26BAjOIbo4QqOHBXk/WPen1iC3DAoGBALsD3DSj46puCMJA2ebI
2EoWaDGUbgZny2GxiwrvHL7XIx1XbHg7zxhUSLBorrNW7nsxJ6m3ugUo/bjxV4LN
L59Gc27ByMvbqmvRbRcAKIJCkrB1Pirnkr2f+xx8nLEotGqNNYIawlzKnqr6SbGf
Y2wAGWKmPyEoPLMLWLYkhfdtAoGANsFa/Tf+wuMTqZuAVXCwhOxsfnKy+MNy9jiZ
XVwuFlDGqVIKpjkmJyhT9KVmRM/qePwgqMSgBvVOnszrxcGRmpXRBzlh6yPYiQyK
2U4f5dJG97j9W7U1TaaXcCCfqdZDMKnmB7hMn8NLbqK5uLBQrltMIgt1tjIOfofv
BNx0raECgYEApAvjwDJ75otKz/mvL3rUf/SNpieODBOLHFQqJmF+4hrSOniHC5jf
f5GS5IuYtBQ1gudBYlSs9fX6T39d2avPsZjfvvSbULXi3OlzWD8sbTtvQPuCaZGI
Df9PUWMYZ3HRwwdsYovSOkT53fG6guy+vElUEDkrpZYczROZ6GUcx70=
-----END RSA PRIVATE KEY-----
"""
USER_DATA = """#cloud-config
users:
- default
- name: root
groups: sudo
shell: /bin/bash
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDUOtNJdBEXyKxBB898rdT54ULjMGuO6v4jLXmRsdRhR5Id/lKNc9hsdioPWUePgYlqML2iSV72vKQoVhkyYkpcsjr3zvBny9+5xej3+TBLoEMAm2hmllKPmxYJDU8jQJ7wJuRrOVOnk0iSNF+FcY/yaQ0owSF02Nphx47j2KWc0IjGGlt4fl0fmHJuZBA2afN/4IYIIsEWZziDewVtaEjWV3InMRLllfdqGMllhFR+ed2hQz9PN2QcapmEvUR4UCy/mJXrke5htyFyHi8ECfyMMyYeHwbWLFQIve4CWix9qtksvKjcetnxT+WWrutdr3c9cfIj/c0v/Zg/c4zETxtp standard-test-qcow2
ssh_pwauth: True
chpasswd:
list: |
root:foobar
expire: False
runcmd:
- mkfs.ext4 /dev/sdb
- mount /dev/sdb /usr/local
- sudo mount -o remount,rw /usr
- mkdir /expected /output
"""
def main(argv):
parser = argparse.ArgumentParser(description="Inventory for a QCow2 test image")
parser.add_argument("--list", action="store_true", help="Verbose output")
parser.add_argument('--host', help="Get host variables")
parser.add_argument("subjects", nargs="*", default=shlex.split(os.environ.get("TEST_SUBJECTS", "")))
opts = parser.parse_args()
try:
if opts.host:
data = host(opts.host)
else:
data = list(opts.subjects)
sys.stdout.write(json.dumps(data, indent=4, separators=(',', ': ')))
except RuntimeError as ex:
sys.stderr.write("{0}: {1}\n".format(os.path.basename(sys.argv[0]), str(ex)))
return 1
return 0
def list(subjects):
hosts = []
variables = {}
for subject in subjects:
if subject.endswith((".qcow2", ".qcow2c")):
vars = host(subject)
if vars:
hosts.append(subject)
variables[subject] = vars
return {"localhost": {"hosts": hosts, "vars": {}}, "subjects": {"hosts": hosts, "vars": {}},
"_meta": {"hostvars": variables}}
def start_qemu(image, cloudinit, log, disk_directory=None, disk_size=None, portrange=(2222, 5555)):
for port in xrange(*portrange):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
try:
sock.bind(("127.0.0.3", port))
if disk_size:
return subprocess.Popen(["/usr/bin/qemu-system-x86_64", "-m", "1024", image,
"-enable-kvm", "-snapshot", "-cdrom", cloudinit,
"-hdb", disk_directory,
"-net", "nic,model=virtio", "-net",
"user,hostfwd=tcp:127.0.0.3:{0}-:22".format(port),
"-device", "isa-serial,chardev=pts2", "-chardev", "file,id=pts2,path=" + log,
"-display", "none"], stdout=open(os.devnull, 'w')), port
else:
return subprocess.Popen(["/usr/bin/qemu-system-x86_64", "-m", "1024", image,
"-enable-kvm", "-snapshot", "-cdrom", cloudinit,
"-net", "nic,model=virtio", "-net",
"user,hostfwd=tcp:127.0.0.3:{0}-:22".format(port),
"-device", "isa-serial,chardev=pts2", "-chardev", "file,id=pts2,path=" + log,
"-display", "none"], stdout=open(os.devnull, 'w')), port
except IOError:
pass
finally:
sock.close()
else:
raise RuntimeError("unable to find free local port to map SSH to")
def host(image):
null = open(os.devnull, 'w')
try:
tty = os.open("/dev/tty", os.O_WRONLY)
os.dup2(tty, 2)
except OSError:
tty = None
pass
# A directory for temporary stuff
directory = tempfile.mkdtemp(prefix="inventory-cloud")
identity = os.path.join(directory, "identity")
with open(identity, 'w') as f:
f.write(IDENTITY)
os.chmod(identity, 0o600)
metadata = os.path.join(directory, "meta-data")
with open(metadata, 'w') as f:
f.write("")
userdata = os.path.join(directory, "user-data")
with open(userdata, 'w') as f:
f.write(USER_DATA)
# Create additional disk
disk_size = None
disk_directory = None
try:
disk_size = os.environ.get("EXTEND_DISK_SIZE")
if disk_size:
sys.stderr.write("\nCreate additional cloud init disk DISK SIZE {}\n".format(disk_size))
disk_directory = "{}/atomic-host-disk2-{}".format(directory, disk_size)
subprocess.check_call(["qemu-img", "create", "-f", "qcow2", disk_directory, disk_size], stdout=null)
except KeyError:
sys.stderr.write("\nCouldn't create additional cloud init disk DISK SIZE\n")
pass
# Create our cloud init so we can log in
cloudinit = os.path.join(directory, "cloud-init.iso")
subprocess.check_call(["/usr/bin/genisoimage", "-input-charset", "utf-8",
"-volid", "cidata", "-joliet", "-rock", "-quiet",
"-output", cloudinit, userdata, metadata], stdout=null)
# Determine if virtual machine should be kept available for diagnosis after completion
try:
diagnose = distutils.util.strtobool(os.getenv("TEST_DEBUG", "0"))
except ValueError:
diagnose = 0
sys.stderr.write("Launching virtual machine for {0}\n".format(image))
# And launch the actual VM
artifacts = os.environ.get("TEST_ARTIFACTS", os.path.join(os.getcwd(), "artifacts"))
try:
os.makedirs(artifacts)
except OSError as exc:
if exc.errno != errno.EEXIST or not os.path.isdir(artifacts):
raise
log = os.path.join(artifacts, "{0}.log".format(os.path.basename(image)))
proc = None # for failure detection
cpe = None # for exception scoping
for tries in xrange(0, 5):
try:
proc, port = start_qemu(image, cloudinit, log, disk_directory=disk_directory, disk_size=disk_size)
break
except subprocess.CalledProcessError as cpe:
time.sleep(1)
continue
if proc is None:
raise RuntimeError("Could not launch VM for qcow2 image"
" '{0}':{1}".format(image, cpe.output))
# The variables
variables = {"ansible_ssh_port": "{0}".format(port),
"ansible_ssh_host": "127.0.0.3",
"ansible_ssh_user": "root",
"ansible_ssh_pass": "foobar",
"ansible_ssh_private_key_file": identity,
"ansible_ssh_common_args": "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"}
# Write out a handy inventory file, for our use and for debugging
args = " ".join(["{0}='{1}'".format(*item) for item in variables.items()])
inventory = os.path.join(directory, "inventory")
with open(inventory, "w") as f:
f.write("[subjects]\nlocalhost {1}\n".format(image, args))
# Wait for ssh to come up
ping = ["/usr/bin/ansible", "--inventory", inventory, "localhost", "--module-name", "raw", "--args", "/bin/true"]
for tries in xrange(0, 30):
try:
(pid, ret) = os.waitpid(proc.pid, os.WNOHANG)
if pid != 0:
raise RuntimeError("qemu failed to launch qcow2 image: {0}".format(image))
subprocess.check_call(ping, stdout=null, stderr=null)
break
except subprocess.CalledProcessError:
time.sleep(3)
else:
# Kill the qemu process
try:
os.kill(proc.pid, signal.SIGTERM)
except OSError:
pass
raise RuntimeError("could not access launched qcow2 image: {0}".format(image))
# Process of our parent
ppid = os.getppid()
child = os.fork()
if child:
return variables
# Daemonize and watch the processes
os.chdir("/")
os.setsid()
os.umask(0)
if tty is None:
tty = null.fileno()
# Duplicate standard input to standard output and standard error.
os.dup2(null.fileno(), 0)
os.dup2(tty, 1)
os.dup2(tty, 2)
# Now wait for the parent process to go away, then kill the VM
while True:
time.sleep(3)
try:
os.kill(ppid, 0)
os.kill(proc.pid, 0)
except OSError:
break # Either of the processes no longer exist
if diagnose:
sys.stderr.write("\n")
sys.stderr.write("DIAGNOSE: ssh -p {0} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "
"root@{1} # password: {2}\n".format(port, "127.0.0.3", "foobar"))
sys.stderr.write("DIAGNOSE: export ANSIBLE_INVENTORY={0}\n".format(inventory))
sys.stderr.write("DIAGNOSE: kill {0} # when finished\n".format(os.getpid()))
def _signal_handler(*args):
sys.stderr.write("\nDIAGNOSE ending...\n")
signal.signal(signal.SIGTERM, _signal_handler)
signal.pause()
# Kill the qemu process
try:
os.kill(proc.pid, signal.SIGTERM)
except OSError:
pass
shutil.rmtree(directory)
sys.exit(0)
if __name__ == '__main__':
sys.exit(main(sys.argv))

View file

@ -1,12 +0,0 @@
---
- hosts: localhost
roles:
- role: standard-test-beakerlib
tags:
- classic
- container
- atomic
tests:
- Sanity-init-scripts-LSB
required_packages:
- initscripts