From Peter Wu via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9174
Reorg more of the test variables, still separating source and test directories. More minor fixes from me. svn path=/trunk/; revision=52412
This commit is contained in:
parent
7888bec0bc
commit
62c230c7b1
|
@ -100,11 +100,9 @@ export WIRESHARK_QUIT_AFTER_CAPTURE="True"
|
|||
CAPTURE_DIR="$TESTS_DIR/captures/"
|
||||
|
||||
# Configuration paths
|
||||
TEST_HOME="$PWD/fakehome"
|
||||
HOME_ENV="HOME"
|
||||
|
||||
if [ "$WS_SYSTEM" == "Windows" ] ; then
|
||||
TEST_HOME="`cygpath -w $TEST_HOME`"
|
||||
HOME_ENV="APPDATA"
|
||||
CAPTURE_DIR="`cygpath -w $CAPTURE_DIR`"
|
||||
fi
|
||||
|
|
|
@ -56,15 +56,9 @@ fi
|
|||
|
||||
#TS_ARGS="-Tfields -e frame.number -e frame.time_epoch -e frame.time_delta"
|
||||
TS_DC_ARGS=""
|
||||
TS_DC_ENV="${HOME_ENV}=${TEST_HOME}"
|
||||
|
||||
DIFF_OUT=./diff-output.txt
|
||||
|
||||
# We create UATs in the source directory. Add a unique ID so we can avoid
|
||||
# deleting files we shouldn't.
|
||||
DC_ID="suite-decryption.sh-$$"
|
||||
|
||||
|
||||
# WPA PSK
|
||||
# http://wiki.wireshark.org/SampleCaptures?action=AttachFile&do=view&target=wpa-Induction.pcap
|
||||
decryption_step_80211_wpa_psk() {
|
||||
|
@ -135,27 +129,21 @@ tshark_decryption_suite() {
|
|||
}
|
||||
|
||||
decryption_cleanup_step() {
|
||||
for UAT in $UAT_FILES ; do
|
||||
grep $DC_ID $WS_BIN_PATH/$UAT > /dev/null 2>&1
|
||||
RETURNVALUE=$?
|
||||
if [ $RETURNVALUE -eq $EXIT_OK ]; then
|
||||
rm -f $WS_BIN_PATH/$UAT
|
||||
fi
|
||||
done
|
||||
rm -rf fakehome
|
||||
rm -rf "$TEST_HOME"
|
||||
}
|
||||
|
||||
decryption_prep_step() {
|
||||
decryption_cleanup_step
|
||||
mkdir fakehome
|
||||
|
||||
TEST_HOME="$TEST_OUTDIR/home"
|
||||
DOTWS_DIR="$TEST_HOME/.wireshark"
|
||||
TS_DC_ENV="${HOME_ENV}=${TEST_HOME}"
|
||||
mkdir -p "$DOTWS_DIR"
|
||||
|
||||
for UAT in $UAT_FILES ; do
|
||||
if [ -f $WS_BIN_PATH/$UAT ] ; then
|
||||
test_remark_add "$WS_BIN_PATH/$UAT exists. One or more tests may fail."
|
||||
else
|
||||
echo "# Created by $DC_ID" > $WS_BIN_PATH/$UAT
|
||||
sed -e "s|TEST_KEYS_DIR|${TEST_KEYS_DIR//\\/\\\\x5c}|" < "$TESTS_DIR/config/$UAT.tmpl" >> "$WS_BIN_PATH/$UAT"
|
||||
fi
|
||||
sed -e "s|TEST_KEYS_DIR|${TEST_KEYS_DIR//\\/\\\\x5c}|" \
|
||||
< "$TESTS_DIR/config/$UAT.tmpl" \
|
||||
> "$DOTWS_DIR/$UAT"
|
||||
done
|
||||
}
|
||||
|
||||
|
|
|
@ -30,16 +30,8 @@ EXIT_ERROR=2
|
|||
|
||||
#TS_ARGS="-Tfields -e frame.number -e frame.time_epoch -e frame.time_delta"
|
||||
TS_NR_ARGS="-r $CAPTURE_DIR/dns+icmp.pcapng.gz"
|
||||
TS_NR_ENV="WIRESHARK_RUN_FROM_BUILD_DIRECTORY=1 ${HOME_ENV}=${TEST_HOME}"
|
||||
|
||||
if [ "$WS_SYSTEM" == "Windows" ] ; then
|
||||
CONF_PATH="$TEST_HOME/Wireshark"
|
||||
else
|
||||
CONF_PATH="$TEST_HOME/.wireshark"
|
||||
fi
|
||||
|
||||
CUSTOM_PROFILE_NAME="Custom-$$"
|
||||
CUSTOM_PROFILE_PATH="$CONF_PATH/profiles/$CUSTOM_PROFILE_NAME"
|
||||
|
||||
# nameres.network_name: True
|
||||
# nameres.use_external_name_resolver: False
|
||||
|
@ -167,6 +159,14 @@ name_resolution_cleanup_step() {
|
|||
}
|
||||
|
||||
name_resolution_prep_step() {
|
||||
if [ "$WS_SYSTEM" == "Windows" ] ; then
|
||||
CONF_PATH="$TEST_OUTDIR/home/Wireshark"
|
||||
else
|
||||
CONF_PATH="$TEST_OUTDIR/home/.wireshark"
|
||||
fi
|
||||
CUSTOM_PROFILE_PATH="$CONF_PATH/profiles/$CUSTOM_PROFILE_NAME"
|
||||
TS_NR_ENV="WIRESHARK_RUN_FROM_BUILD_DIRECTORY=1 ${HOME_ENV}=${TEST_OUTDIR}/home"
|
||||
|
||||
name_resolution_cleanup_step
|
||||
mkdir -p "$CUSTOM_PROFILE_PATH"
|
||||
cp "$TESTS_DIR/hosts.global" "$WS_BIN_PATH/hosts"
|
||||
|
|
|
@ -84,10 +84,12 @@ fi
|
|||
|
||||
test_cleanup() {
|
||||
if [ $TEST_OUTDIR_CLEAN = 1 ]; then
|
||||
# display contents of test outputs
|
||||
grep -r . .
|
||||
# display contents of test outputs, ignore directory:
|
||||
# home (decryption suite)
|
||||
grep -r . --exclude-dir=home .
|
||||
rm -rf "$TEST_OUTDIR"
|
||||
else
|
||||
elif ! rmdir "$TEST_OUTDIR" 2>/dev/null; then
|
||||
# if directory is non-empty, print directory
|
||||
echo "Test results are available in $TEST_OUTDIR"
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue