Skip to content

Commit

Permalink
Change localhost to 127.0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanberger committed Apr 9, 2020
1 parent 7a78b12 commit 13d7f75
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/swtpm_setup/swtpm_setup.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ start_tpm()
ctr2=0
while [ -f "${pidfile}" ]; do
# test the connection to swtpm
(exec 100<>"/dev/tcp/localhost/$TPM_PORT") 2>/dev/null
(exec 100<>"/dev/tcp/127.0.0.1/$TPM_PORT") 2>/dev/null
if [ $? -ne 0 ]; then
if [ $ctr2 -eq 40 ]; then
stop_tpm 0
Expand Down Expand Up @@ -532,12 +532,12 @@ EOF
stop_tcsd 1
case "$(id -u)" in
0)
$TCSD -c "$TCSD_CONFIG" -e -f &>/dev/null &
TCSD_TCP_DEVICE_HOSTNAME=127.0.0.1 $TCSD -c "$TCSD_CONFIG" -e -f &>/dev/null &
TCSD_PID=$!
;;
*)
# for tss user, use the wrapper
$TCSD -c "$TCSD_CONFIG" -e -f &>/dev/null &
TCSD_TCP_DEVICE_HOSTNAME=127.0.0.1 $TCSD -c "$TCSD_CONFIG" -e -f &>/dev/null &
#if [ $? -ne 0]; then
# swtpm_tcsd_launcher -c $TCSD_CONFIG -e -f &>/dev/null &
#fi
Expand All @@ -549,7 +549,7 @@ EOF
# disappeared (bad); whatever happens first
ctr2=0
while :; do
(exec 100<>"/dev/tcp/localhost/$TSS_TCSD_PORT") 2>/dev/null
(exec 100<>"/dev/tcp/127.0.0.1/$TSS_TCSD_PORT") 2>/dev/null
if [ $? -ne 0 ]; then
if [ $ctr2 -eq 40 ]; then
stop_tcsd 0
Expand Down
4 changes: 4 additions & 0 deletions tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ TESTS += \
endif
endif

TESTS = \
test_parameters \
test_swtpm_setup_create_cert

EXTRA_DIST=$(TESTS) \
swtpm_setup.conf \
common \
Expand Down
4 changes: 2 additions & 2 deletions tests/test_tpm12
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ TESTLOG=${WORKDIR}/test.log

# variables used by the TPM 1.2 test suite
TPM_SERVER_PORT=65440
TPM_SERVER_NAME=localhost
TPM_SERVER_NAME=127.0.0.1
SLAVE_TPM_PORT=65442
SLAVE_TPM_SERVER=localhost
SLAVE_TPM_SERVER=127.0.0.1

SWTPM_INTERFACE=socket+socket

Expand Down
4 changes: 2 additions & 2 deletions tests/test_tpm2_ibmtss2
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ROOT=${abs_top_builddir:-$(pwd)/..}
TESTDIR=${abs_top_testdir:-$(dirname "$0")}

SWTPM_SERVER_PORT=65426
SWTPM_SERVER_NAME=localhost
SWTPM_SERVER_NAME=127.0.0.1
SWTPM_CTRL_PORT=65427
SWTPM_INTERFACE=socket+socket

Expand Down Expand Up @@ -94,7 +94,7 @@ if [ $revision -gt 0 ]; then
popd &>/dev/null
fi

export TPM_SERVER_NAME=localhost
export TPM_SERVER_NAME=127.0.0.1
export TPM_INTERFACE_TYPE=socsim
export TPM_COMMAND_PORT=${SWTPM_SERVER_PORT}
export TPM_PLATFORM_PORT=${SWTPM_CTRL_PORT}
Expand Down
1 change: 1 addition & 0 deletions tests/test_tpm2_save_load_state_3
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,7 @@ function test_primary_volatile_load()
}

export TPM_SERVER_TYPE=raw
export TPM_SERVER_NAME=127.0.0.1
export TPM_INTERFACE_TYPE=socsim
export TPM_COMMAND_PORT=55533
export TPM_DATA_DIR=$TPMDIR
Expand Down

0 comments on commit 13d7f75

Please sign in to comment.