diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e0c51433d3..d312c6389a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -459,3 +459,32 @@ db-snapshot: retry: 2 tags: - zombienet-polkadot-integration-test + +multiple-networks: + stage: deploy + <<: *kubernetes-env + image: "paritypr/zombienet:${CI_COMMIT_SHORT_SHA}" + rules: + - if: $CI_PIPELINE_SOURCE == "schedule" + - if: $CI_COMMIT_REF_NAME == "master" + - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs + - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 + # needs: + # - job: publish-docker-pr + + variables: + GH_DIR: "https://github.com/paritytech/zombienet/tree/${CI_COMMIT_SHORT_SHA}/tests" + + before_script: + - echo "Zombienet multiple networks test" + - echo "paritypr/zombienet:${CI_COMMIT_SHORT_SHA}" + - echo "${GH_DIR}" + - export DEBUG=zombie* + + script: + - /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh + --test="0014-multiple-networks.zndsl" + allow_failure: true + retry: 2 + tags: + - zombienet-polkadot-integration-test diff --git a/examples/0005-multiple-networks.zndsl b/examples/0005-multiple-networks.zndsl new file mode 100644 index 0000000000..24e4d88abc --- /dev/null +++ b/examples/0005-multiple-networks.zndsl @@ -0,0 +1,17 @@ +Description: Multiple Networks test +Network: ./0000-test-config-small-network.toml +Network: ./0003-big-network.toml +Creds: config + +# 0000-test-config-small-network - metrics +alice: reports node_roles is 4 +alice: reports sub_libp2p_is_major_syncing is 0 + +# 0000-test-config-small-network - logs +bob: log line matches glob "*rted #1*" within 10 seconds +bob: log line matches "Imported #[0-9]+" within 10 seconds + +# 0003-big-network - metrics +a: reports node_roles is 4 +b: reports sub_libp2p_is_major_syncing is 0 + diff --git a/tests/0014-multiple-networks.zndsl b/tests/0014-multiple-networks.zndsl new file mode 100644 index 0000000000..a8fb694b8d --- /dev/null +++ b/tests/0014-multiple-networks.zndsl @@ -0,0 +1,16 @@ +Description: Multiple Networks test +Network: ./0014-network-1.toml +Network: ./0014-network-2.toml +Creds: config + +# network-1 - metrics +alice: reports node_roles is 4 +alice: reports sub_libp2p_is_major_syncing is 0 + +# network-1 - logs +bob: log line matches glob "*rted #1*" within 10 seconds +bob: log line matches "Imported #[0-9]+" within 10 seconds + +# network-2 - metrics +a: reports node_roles is 4 +b: reports sub_libp2p_is_major_syncing is 0 \ No newline at end of file diff --git a/tests/0014-network-1.toml b/tests/0014-network-1.toml new file mode 100644 index 0000000000..a802cdfafb --- /dev/null +++ b/tests/0014-network-1.toml @@ -0,0 +1,16 @@ +[relaychain] +default_image = "docker.io/parity/polkadot:latest" +default_command = "polkadot" +default_args = [ "-lparachain=debug" ] + +chain = "rococo-local" + + [[relaychain.nodes]] + name = "alice" + validator = true + + [[relaychain.nodes]] + name = "bob" + image = "docker.io/parity/polkadot:latest" + validator = true + args = ["--database=paritydb-experimental"] diff --git a/tests/0014-network-2.toml b/tests/0014-network-2.toml new file mode 100644 index 0000000000..0dcccc3343 --- /dev/null +++ b/tests/0014-network-2.toml @@ -0,0 +1,25 @@ +[relaychain] +default_image = "docker.io/parity/polkadot:latest" +default_command = "polkadot" +default_args = [ "-lparachain=debug" ] + +chain = "rococo-local" + + [[relaychain.node_groups]] + name = "a" + args = [ "-lparachain=debug", "--database=paritydb-experimental" ] + count = 5 + + [[relaychain.node_groups]] + name = "b" + count = 5 + +[[parachains]] +id = 100 + + [[parachains.collator_groups]] + count = 2 + [parachains.collator_groups.collator] + name = "collator" + command = "polkadot-parachain" + image = "docker.io/parity/polkadot-parachain:latest" \ No newline at end of file