Initial code checkin
[grml-unittests.git] / autoconfig / unit_tests / sshd.sh
1 #!/bin/zsh
2
3 setopt shwordsplit
4
5 oneTimeSetUp() {
6     OLDPATH=$PATH
7     mkdir -p /cdrom/bootparams
8     echo ssh > /cdrom/bootparams/enable-ssh
9     . /etc/grml/autoconfig.functions
10     PATH=$OLDPATH
11     config_ssh
12 }
13
14 oneTimeTearDown() {
15     rm -rf /cdrom/bootparams
16     /etc/init.d/ssh stop
17 }
18
19 test_runing_ssh() {
20     SSH_PID=$(pidof sshd)
21     assertNotNull "No running sshd found" "$SSH_PID"
22 }
23 test_grml_password() {
24     getent shadow grml | grep -q "grml:*:"
25     assertEquals "Wrong password for user grml!" 0 $?
26 }
27
28 SHUNIT_PARENT=$0
29 . /tmp/tests/shunit2