still working on telnet tester
This commit is contained in:
49
test_path.sh
Normal file
49
test_path.sh
Normal file
@@ -0,0 +1,49 @@
|
||||
#! /bin/bash
|
||||
|
||||
test_name="Path Test"
|
||||
|
||||
config_file="default.config"
|
||||
port=4040
|
||||
host="localhost"
|
||||
|
||||
#paths=("/" "/test" "/test/" "/list" "list" "/wrong") # you can add many
|
||||
paths=("/") # you can add many
|
||||
methods=("GET" "POST" "DELETE")
|
||||
#methods=("GET")
|
||||
httpz=("HTTP/1.1")
|
||||
|
||||
|
||||
|
||||
l1="${methods[0]} ${paths[0]} ${httpz[0]}"
|
||||
|
||||
header="Host: $host"
|
||||
body=
|
||||
|
||||
|
||||
run_this_test()
|
||||
{
|
||||
|
||||
for i in "${paths[@]}"
|
||||
do
|
||||
l1="${methods[0]} $i ${httpz[0]}"
|
||||
request="$l1\n$header\n$body\n"
|
||||
{
|
||||
echo "----- $test_name -----"
|
||||
echo -e "$_RED$request$_END"
|
||||
} >> telnet.out
|
||||
echo -e "$request"
|
||||
sleep 1
|
||||
echo -e "\n\n" >> telnet.out
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
# expected result...
|
||||
|
||||
|
||||
expected_result_file="./expected_results/expected_path_test.txt"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user