Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Description: There are configuration changes from apache2.2 to apache… #136

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions linux-tools/httpd_tools/httpd-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#cd `dirname $0`
#LTPBIN=${LTPBIN%/shared}/httpd_tools
source $LTPBIN/tc_utils.source
SDIR=${LTPBIN%/shared}/httpd_tools/
SDIR=${LTPBIN%/shared}/httpd_tools

# system files
HTTPD_CONF="/etc/httpd/conf/httpd.conf"
Expand All @@ -41,6 +41,7 @@ TOOLS="ab htdbm htdigest htpasswd logresolve"
#
function tc_local_setup()
{
TCTMP=$SDIR/tmp
tc_root_or_break || exit
tc_exec_or_break cat grep || exit

Expand All @@ -59,6 +60,7 @@ function tc_local_setup()
httpd_cleanup=1

# backup files which are touched by the testcase.
mkdir $TCTMP
cp -f $HTTPD_CONF $TCTMP/httpd.conf

HOST="127.0.0.1"
Expand All @@ -76,8 +78,7 @@ function tc_local_setup()
<Directory "$TCTMP/test">
Options Indexes MultiViews FollowSymLinks ExecCGI
AllowOverride None
Order allow,deny
Allow from all
Require all granted
</Directory>

EOF
Expand Down Expand Up @@ -106,10 +107,14 @@ function tc_local_cleanup()
{
cp -rf $TCTMP/httpd.conf $HTTPD_CONF
service httpd restart >$stdout 2>$stderr

if [ -d $TCTMP ]; then
rm -rf $TCTMP
fi

# Restore status of httpd service
if [ $httpd_cleanup -eq 0 ]; then
service httpd stop >$stdout 2>$stderr
systemctl stop httpd >$stdout 2>$stderr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tc_service macros cant be used here ?

tc_break_if_bad $? "failed to stop httpd"
fi
}
Expand Down Expand Up @@ -204,7 +209,7 @@ function htdbm_test()

sed -i 's/AuthType Digest/AuthType Basic/g' $HTTPD_CONF
sed -i 's/AuthBasicProvider file/AuthBasicProvider dbm/g' $HTTPD_CONF
sed -i 's:AuthUserFile $TCTMP/test/passwd_file:AuthDBMUserFile $TCTMP/test/passwd_file:g' $HTTPD_CONF
sed -i 's:AuthUserFile:AuthDBMUserFile:g' $HTTPD_CONF

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please explain why this change is required here

expect -c "spawn htdbm -c $TCTMP/test/passwd_file $USER; expect \"*password*:\"; send -- \"password\r\"; expect \"*password*:\"; send -- \"password\r\"; expect eof"
tc_fail_if_bad $? "htdbm -c failed to create password"
Expand Down