Blame tests/p_shadow-utils/38-grpunconv-tests

Athmane Madjoudj 536354
#!/bin/bash
Athmane Madjoudj 536354
# Author: Iain Douglas <centos@1n6.org.uk>
Athmane Madjoudj 536354
Athmane Madjoudj 536354
echo "Running $0"
Athmane Madjoudj 536354
cleanup() {
Athmane Madjoudj 536354
echo "Reverting files to original state"
Athmane Madjoudj 536354
[[ -d /var/tmp/grpunconv ]] &&  cp /var/tmp/grpunconv/* /etc && rm -r /var/tmp/grpunconv
Athmane Madjoudj 536354
}
Athmane Madjoudj 536354
Athmane Madjoudj 536354
# Test grpunconv 
Athmane Madjoudj 536354
# Check we have both /etc/group and /etc/gshadow  then save them
Athmane Madjoudj 536354
[[ -e /etc/group && -e /etc/gshadow ]] || { t_Log "FAIL: missing source file"; exit $FAIL; }
Athmane Madjoudj 536354
Athmane Madjoudj 536354
mkdir -p /var/tmp/grpunconv || { t_Log "FAIL: Unable to create directory to save source files in "; exit $FAIL; }
Athmane Madjoudj 536354
cp /etc/group /etc/gshadow /var/tmp/grpunconv || { t_Log "FAIL: Unable to save source files"; exit $FAIL; }
Athmane Madjoudj 536354
Athmane Madjoudj 536354
#Check the source files are sane
Athmane Madjoudj 536354
echo "Checking source files are sane"
Athmane Madjoudj 536354
grpck
Athmane Madjoudj 536354
t_CheckExitStatus $?
Athmane Madjoudj 536354
trap cleanup EXIT
Athmane Madjoudj 536354
echo "Converting /etc/group and /etc/gshadow to merged /etc/group"
Athmane Madjoudj 536354
grpunconv
Athmane Madjoudj 536354
t_CheckExitStatus $?