Skip to content

Commit

Permalink
Revert "Fix e2e tests"
Browse files Browse the repository at this point in the history
This reverts commit c264d4f.
  • Loading branch information
bermuell committed Nov 7, 2023
1 parent eef2a04 commit 14741dc
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 37 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 0 additions & 6 deletions tests/e2e/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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\" | " +
Expand Down Expand Up @@ -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\" | " +
Expand All @@ -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\" | " +
Expand Down Expand Up @@ -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\" | " +
Expand All @@ -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\" | " +
Expand Down Expand Up @@ -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\" | " +
Expand Down
26 changes: 13 additions & 13 deletions tests/e2e/testnet-scripts/start-chain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -178,23 +178,23 @@ 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 \
--keyring-backend test \
--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/
fi
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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
18 changes: 9 additions & 9 deletions tests/e2e/testnet-scripts/start-changeover.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -84,15 +84,15 @@ 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
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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -184,4 +184,4 @@ set -e

echo "done!!!!!!!!"

read -p "Press Return to Close..."
read -p "Press Return to Close..."
16 changes: 8 additions & 8 deletions tests/e2e/testnet-scripts/start-sovereign.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -130,4 +130,4 @@ set -e

echo "done!!!!!!!!"

read -p "Press Return to Close..."
read -p "Press Return to Close..."

0 comments on commit 14741dc

Please sign in to comment.