From 14741dc6ec54386c3a37fc6b034729e78fb8b50d Mon Sep 17 00:00:00 2001 From: Bernd Mueller Date: Tue, 7 Nov 2023 12:03:38 +0100 Subject: [PATCH] Revert "Fix e2e tests" This reverts commit c264d4f69faeae786ac9fe17b4bd6182ad5ce90d. --- Dockerfile | 2 +- tests/e2e/config.go | 6 ----- tests/e2e/testnet-scripts/start-chain.sh | 26 +++++++++---------- tests/e2e/testnet-scripts/start-changeover.sh | 18 ++++++------- tests/e2e/testnet-scripts/start-sovereign.sh | 16 ++++++------ 5 files changed, 31 insertions(+), 37 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5066d3af17..de183457d0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ ADD . /interchain-security WORKDIR /interchain-security -# Do not specify version here. It leads to odd replacement behavior +# Do not specify version here. It leads to odd replacement behavior RUN if [ -d "./cosmos-sdk" ]; then go mod edit -replace github.com/cosmos/cosmos-sdk=./cosmos-sdk; fi RUN go mod tidy diff --git a/tests/e2e/config.go b/tests/e2e/config.go index 749ea0f4bd..4e025f03e7 100644 --- a/tests/e2e/config.go +++ b/tests/e2e/config.go @@ -184,7 +184,6 @@ func SlashThrottleTestRun() TestRun { ipPrefix: "7.7.8", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + - ".app_state.gov.params.expedited_voting_period = \"10s\" | " + ".app_state.slashing.params.signed_blocks_window = \"15\" | " + ".app_state.slashing.params.min_signed_per_window = \"0.500000000000000000\" | " + ".app_state.slashing.params.downtime_jail_duration = \"60s\" | " + @@ -231,7 +230,6 @@ func DefaultTestRun() TestRun { ipPrefix: "7.7.8", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + - ".app_state.gov.params.expedited_voting_period = \"10s\" | " + ".app_state.slashing.params.signed_blocks_window = \"15\" | " + ".app_state.slashing.params.min_signed_per_window = \"0.500000000000000000\" | " + ".app_state.slashing.params.downtime_jail_duration = \"60s\" | " + @@ -248,7 +246,6 @@ func DefaultTestRun() TestRun { func DemocracyTestRun(allowReward bool) TestRun { consumerGenChanges := ".app_state.ccvconsumer.params.blocks_per_distribution_transmission = \"20\" | " + ".app_state.gov.voting_params.voting_period = \"10s\" | " + - ".app_state.gov.params.expedited_voting_period = \"5s\" | " + ".app_state.slashing.params.signed_blocks_window = \"10\" | " + ".app_state.slashing.params.min_signed_per_window = \"0.500000000000000000\" | " + ".app_state.slashing.params.downtime_jail_duration = \"60s\" | " + @@ -331,7 +328,6 @@ func MultiConsumerTestRun() TestRun { ipPrefix: "7.7.8", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + - ".app_state.gov.params.expedited_voting_period = \"10s\" | " + ".app_state.slashing.params.signed_blocks_window = \"10\" | " + ".app_state.slashing.params.min_signed_per_window = \"0.500000000000000000\" | " + ".app_state.slashing.params.downtime_jail_duration = \"60s\" | " + @@ -343,7 +339,6 @@ func MultiConsumerTestRun() TestRun { ipPrefix: "7.7.9", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + - ".app_state.gov.params.expedited_voting_period = \"10s\" | " + ".app_state.slashing.params.signed_blocks_window = \"10\" | " + ".app_state.slashing.params.min_signed_per_window = \"0.500000000000000000\" | " + ".app_state.slashing.params.downtime_jail_duration = \"60s\" | " + @@ -391,7 +386,6 @@ func ChangeoverTestRun() TestRun { ipPrefix: "7.7.8", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + - ".app_state.gov.params.expedited_voting_period = \"10s\" | " + ".app_state.slashing.params.signed_blocks_window = \"15\" | " + ".app_state.slashing.params.min_signed_per_window = \"0.500000000000000000\" | " + ".app_state.slashing.params.downtime_jail_duration = \"60s\" | " + diff --git a/tests/e2e/testnet-scripts/start-chain.sh b/tests/e2e/testnet-scripts/start-chain.sh index 65221ca5d7..4c5a8c61ae 100644 --- a/tests/e2e/testnet-scripts/start-chain.sh +++ b/tests/e2e/testnet-scripts/start-chain.sh @@ -55,18 +55,18 @@ NODES=$(echo "$VALIDATORS" | jq '. | length') # SETUP NETWORK NAMESPACES, see: https://adil.medium.com/container-networking-under-the-hood-network-namespaces-6b2b8fe8dc2a # Create virtual bridge device (acts like a switch) -ip link add name virtual-bridge type bridge || true +ip link add name virtual-bridge type bridge || true for i in $(seq 0 $(($NODES - 1))); do VAL_ID=$(echo "$VALIDATORS" | jq -r ".[$i].val_id") VAL_IP_SUFFIX=$(echo "$VALIDATORS" | jq -r ".[$i].ip_suffix") NET_NAMESPACE_NAME="$CHAIN_ID-$VAL_ID" - IP_ADDR="$CHAIN_IP_PREFIX.$VAL_IP_SUFFIX/24" + IP_ADDR="$CHAIN_IP_PREFIX.$VAL_IP_SUFFIX/24" - # Create network namespace + # Create network namespace ip netns add $NET_NAMESPACE_NAME - # Create virtual ethernet device to connect with bridge + # Create virtual ethernet device to connect with bridge ip link add $NET_NAMESPACE_NAME-in type veth peer name $NET_NAMESPACE_NAME-out # Connect input end of virtual ethernet device to namespace ip link set $NET_NAMESPACE_NAME-in netns $NET_NAMESPACE_NAME @@ -84,14 +84,14 @@ do VAL_ID=$(echo "$VALIDATORS" | jq -r ".[$i].val_id") NET_NAMESPACE_NAME="$CHAIN_ID-$VAL_ID" - # Enable in/out interfaces for the namespace + # Enable in/out interfaces for the namespace ip link set $NET_NAMESPACE_NAME-out up ip netns exec $NET_NAMESPACE_NAME ip link set dev $NET_NAMESPACE_NAME-in up # Enable loopback device ip netns exec $NET_NAMESPACE_NAME ip link set dev lo up done -# Assign IP for bridge, to route between default network namespace and bridge +# Assign IP for bridge, to route between default network namespace and bridge BRIDGE_IP="$CHAIN_IP_PREFIX.254/24" ip addr add $BRIDGE_IP dev virtual-bridge @@ -129,11 +129,11 @@ do --keyring-backend test \ --recover > /dev/null fi - + # Give validators their initial token allocations # move the genesis in mv /$CHAIN_ID/genesis.json /$CHAIN_ID/validator$VAL_ID/config/genesis.json - + # give this validator some money ALLOCATION=$(echo "$VALIDATORS" | jq -r ".[$i].allocation") $BIN genesis add-genesis-account validator$VAL_ID $ALLOCATION \ @@ -178,7 +178,7 @@ do fi # Make a gentx (this command also sets up validator state on disk even if we are not going to use the gentx for anything) - if [ "$SKIP_GENTX" = "false" ] ; then + if [ "$SKIP_GENTX" = "false" ] ; then STAKE_AMOUNT=$(echo "$VALIDATORS" | jq -r ".[$i].stake") $BIN genesis gentx validator$VAL_ID "$STAKE_AMOUNT" \ --home /$CHAIN_ID/validator$VAL_ID \ @@ -186,7 +186,7 @@ do --moniker validator$VAL_ID \ --chain-id=$CHAIN_ID - # Copy gentxs to the first validator for possible future collection. + # Copy gentxs to the first validator for possible future collection. # Obviously we don't need to copy the first validator's gentx to itself if [ $VAL_ID != $FIRST_VAL_ID ]; then cp /$CHAIN_ID/validator$VAL_ID/config/gentx/* /$CHAIN_ID/validator$FIRST_VAL_ID/config/gentx/ @@ -194,7 +194,7 @@ do fi # Modify tendermint configs of validator - if [ "$TENDERMINT_CONFIG_TRANSFORM" != "" ] ; then + if [ "$TENDERMINT_CONFIG_TRANSFORM" != "" ] ; then #'s/foo/bar/;s/abc/def/' sed -i "$TENDERMINT_CONFIG_TRANSFORM" $CHAIN_ID/validator$VAL_ID/config/config.toml fi @@ -209,7 +209,7 @@ if [ "$SKIP_GENTX" = "false" ] ; then # make the final genesis.json $BIN genesis collect-gentxs --home /$CHAIN_ID/validator$FIRST_VAL_ID - # and copy it to the root + # and copy it to the root cp /$CHAIN_ID/validator$FIRST_VAL_ID/config/genesis.json /$CHAIN_ID/genesis.json # put the now final genesis.json into the correct folders @@ -249,7 +249,7 @@ do do if [ $i -ne $j ]; then PEER_VAL_ID=$(echo "$VALIDATORS" | jq -r ".[$j].val_id") - PEER_VAL_IP_SUFFIX=$(echo "$VALIDATORS" | jq -r ".[$j].ip_suffix") + PEER_VAL_IP_SUFFIX=$(echo "$VALIDATORS" | jq -r ".[$j].ip_suffix") NODE_ID=$($BIN tendermint show-node-id --home /$CHAIN_ID/validator$PEER_VAL_ID) ADDRESS="$NODE_ID@$CHAIN_IP_PREFIX.$PEER_VAL_IP_SUFFIX:26656" # (jq -r '.body.memo' /$CHAIN_ID/validator$j/config/gentx/*) # Getting the address from the gentx should also work diff --git a/tests/e2e/testnet-scripts/start-changeover.sh b/tests/e2e/testnet-scripts/start-changeover.sh index afbccadf72..3bbd832a9d 100644 --- a/tests/e2e/testnet-scripts/start-changeover.sh +++ b/tests/e2e/testnet-scripts/start-changeover.sh @@ -50,7 +50,7 @@ NODES=$(echo "$VALIDATORS" | jq '. | length') # SETUP NETWORK NAMESPACES, see: https://adil.medium.com/container-networking-under-the-hood-network-namespaces-6b2b8fe8dc2a # Create virtual bridge device (acts like a switch) -ip link add name virtual-bridge type bridge || true +ip link add name virtual-bridge type bridge || true for i in $(seq 0 $(($NODES - 1))); do @@ -59,11 +59,11 @@ do VAL_ID=$(echo "$VALIDATORS" | jq -r ".[$i].val_id") VAL_IP_SUFFIX=$(echo "$VALIDATORS" | jq -r ".[$i].ip_suffix") NET_NAMESPACE_NAME="$CHAIN_ID-$VAL_ID" - IP_ADDR="$CHAIN_IP_PREFIX.$VAL_IP_SUFFIX/24" + IP_ADDR="$CHAIN_IP_PREFIX.$VAL_IP_SUFFIX/24" - # Create network namespace + # Create network namespace ip netns add $NET_NAMESPACE_NAME - # Create virtual ethernet device to connect with bridge + # Create virtual ethernet device to connect with bridge ip link add $NET_NAMESPACE_NAME-in type veth peer name $NET_NAMESPACE_NAME-out # Connect input end of virtual ethernet device to namespace ip link set $NET_NAMESPACE_NAME-in netns $NET_NAMESPACE_NAME @@ -84,7 +84,7 @@ do VAL_ID=$(echo "$VALIDATORS" | jq -r ".[$i].val_id") NET_NAMESPACE_NAME="$CHAIN_ID-$VAL_ID" - # Enable in/out interfaces for the namespace + # Enable in/out interfaces for the namespace ip link set $NET_NAMESPACE_NAME-out up ip netns exec $NET_NAMESPACE_NAME ip link set dev $NET_NAMESPACE_NAME-in up # Enable loopback device @@ -92,7 +92,7 @@ do fi done -# Assign IP for bridge, to route between default network namespace and bridge +# Assign IP for bridge, to route between default network namespace and bridge # BRIDGE_IP="$CHAIN_IP_PREFIX.254/24" # ip addr add $BRIDGE_IP dev virtual-bridge @@ -127,7 +127,7 @@ do fi # Modify tendermint configs of validator - if [ "$TENDERMINT_CONFIG_TRANSFORM" != "" ] ; then + if [ "$TENDERMINT_CONFIG_TRANSFORM" != "" ] ; then #'s/foo/bar/;s/abc/def/' sed -i "$TENDERMINT_CONFIG_TRANSFORM" $CHAIN_ID/validator$VAL_ID/config/config.toml fi @@ -160,7 +160,7 @@ do do if [ $i -ne $j ]; then PEER_VAL_ID=$(echo "$VALIDATORS" | jq -r ".[$j].val_id") - PEER_VAL_IP_SUFFIX=$(echo "$VALIDATORS" | jq -r ".[$j].ip_suffix") + PEER_VAL_IP_SUFFIX=$(echo "$VALIDATORS" | jq -r ".[$j].ip_suffix") NODE_ID=$($BIN tendermint show-node-id --home /$CHAIN_ID/validator$PEER_VAL_ID) ADDRESS="$NODE_ID@$CHAIN_IP_PREFIX.$PEER_VAL_IP_SUFFIX:26656" # (jq -r '.body.memo' /$CHAIN_ID/validator$j/config/gentx/*) # Getting the address from the gentx should also work @@ -184,4 +184,4 @@ set -e echo "done!!!!!!!!" -read -p "Press Return to Close..." +read -p "Press Return to Close..." \ No newline at end of file diff --git a/tests/e2e/testnet-scripts/start-sovereign.sh b/tests/e2e/testnet-scripts/start-sovereign.sh index 112f901bc2..34adce39df 100644 --- a/tests/e2e/testnet-scripts/start-sovereign.sh +++ b/tests/e2e/testnet-scripts/start-sovereign.sh @@ -33,17 +33,17 @@ TENDERMINT_CONFIG_TRANSFORM=$6 # SETUP NETWORK NAMESPACES, see: https://adil.medium.com/container-networking-under-the-hood-network-namespaces-6b2b8fe8dc2a # Create virtual bridge device (acts like a switch) -ip link add name virtual-bridge type bridge || true +ip link add name virtual-bridge type bridge || true # used globally in the whole script VAL_ID=$(echo "$VALIDATORS" | jq -r ".[0].val_id") VAL_IP_SUFFIX=$(echo "$VALIDATORS" | jq -r ".[0].ip_suffix") NET_NAMESPACE_NAME="$CHAIN_ID-$VAL_ID" -IP_ADDR="$CHAIN_IP_PREFIX.$VAL_IP_SUFFIX/24" +IP_ADDR="$CHAIN_IP_PREFIX.$VAL_IP_SUFFIX/24" -# Create network namespace +# Create network namespace ip netns add $NET_NAMESPACE_NAME -# Create virtual ethernet device to connect with bridge +# Create virtual ethernet device to connect with bridge ip link add $NET_NAMESPACE_NAME-in type veth peer name $NET_NAMESPACE_NAME-out # Connect input end of virtual ethernet device to namespace ip link set $NET_NAMESPACE_NAME-in netns $NET_NAMESPACE_NAME @@ -56,13 +56,13 @@ ip link set $NET_NAMESPACE_NAME-out master virtual-bridge ip link set virtual-bridge up NET_NAMESPACE_NAME="$CHAIN_ID-$VAL_ID" -# Enable in/out interfaces for the namespace +# Enable in/out interfaces for the namespace ip link set $NET_NAMESPACE_NAME-out up ip netns exec $NET_NAMESPACE_NAME ip link set dev $NET_NAMESPACE_NAME-in up # Enable loopback device ip netns exec $NET_NAMESPACE_NAME ip link set dev lo up -# Assign IP for bridge, to route between default network namespace and bridge +# Assign IP for bridge, to route between default network namespace and bridge BRIDGE_IP="$CHAIN_IP_PREFIX.254/24" ip addr add $BRIDGE_IP dev virtual-bridge @@ -100,7 +100,7 @@ echo "$VALIDATORS" | jq -r ".[0].mnemonic" | $BIN keys add validator$VAL_ID \ --recover > /dev/null # Modify tendermint configs of validator -if [ "$TENDERMINT_CONFIG_TRANSFORM" != "" ] ; then +if [ "$TENDERMINT_CONFIG_TRANSFORM" != "" ] ; then #'s/foo/bar/;s/abc/def/' sed -i "$TENDERMINT_CONFIG_TRANSFORM" $CHAIN_ID/validator$VAL_ID/config/config.toml fi @@ -130,4 +130,4 @@ set -e echo "done!!!!!!!!" -read -p "Press Return to Close..." +read -p "Press Return to Close..." \ No newline at end of file