

# This tests common RPM activities during upgrades, installs, and uninstalls
# under various conditions (SFS running, SFS not running, SFS servers mounted)


# test a normal case, freshen files
rpm -ivh /usr/src/redhat/RPMS/i386/sfs-0.6-5.i386.rpm 
rpm -Fvh /usr/src/redhat/RPMS/i386/sfs-0.7-2.i386.rpm
# make sure sfscd not started
ps auxw| grep sfs | egrep -v grep

rpm -e sfs
# make sure all files removed
find / -name "sfs*"
ls /var/sfs
ls /etc/sfs

# test upgrade when SFS file systems still mounted
rpm -ivh /usr/src/redhat/RPMS/i386/sfs-0.6-5.i386.rpm 
/etc/init.d/sfscd start
cd /sfs/new-york.lcs.mit.edu:85xq6pznt4mgfvj4mb23x6b8adak55ue/pub
rpm -Fvh /usr/src/redhat/RPMS/i386/sfs-0.7-2.i386.rpm 
# test
# should report "Restart sfscd manually after unmounting all remote SFS file systems."
# should report "sfscd dead but subsys locked"
/etc/init.d/sfscd status
/etc/init.d/sfscd start 
# should reort "sfscd (pid [0-9]*) is running..."
/etc/init.d/sfscd status
# should succeed
cd /sfs/@new-york.lcs.mit.edu,u83s4uk49nt8rmp4uwmt2exvz6d3cavh

# test uninstall process when SFS file system mounted
rpm -e sfs
rpm -ivh /usr/src/redhat/RPMS/i386/sfs-0.6-2.i386.rpm   
/etc/init.d/sfscd start
cd /sfs/new-york.lcs.mit.edu:85xq6pznt4mgfvj4mb23x6b8adak55ue
rpm -e sfs
# should report:
#  /bin/rmdir: `/sfs': Device or resource busy
#  Unable to remove /sfs -- remove manually when all file systems unmounted.
# but sfs should get uninstalled otherwise





