diff --git a/.github/workflows/ci_pull_request.yml b/.github/workflows/ci_pull_request.yml index 5e218f2..d911cde 100644 --- a/.github/workflows/ci_pull_request.yml +++ b/.github/workflows/ci_pull_request.yml @@ -9,7 +9,6 @@ name: CI (Pull Request) on: pull_request: - branches: ['main'] push: branches: ['main'] diff --git a/scenarios/run.py b/scenarios/run.py index 8eac053..8a366a6 100755 --- a/scenarios/run.py +++ b/scenarios/run.py @@ -26,7 +26,8 @@ ORDER = [ ("test_containers", 5), ("test_basic_balances", 10), - ("test_storage_e2e", 100), + ("test_storage_e2e", 200), + ("test_multi_copy_upload", 600), ("test_caching_subsystem", 200), ] diff --git a/scenarios/test_multi_copy_upload.py b/scenarios/test_multi_copy_upload.py new file mode 100644 index 0000000..fd2b9d8 --- /dev/null +++ b/scenarios/test_multi_copy_upload.py @@ -0,0 +1,366 @@ +#!/usr/bin/env python3 +"""Multi-copy upload test: upload a random file via filecoin-pin against the devnet.""" + +import os +import re +import subprocess +import sys +import tempfile +import time +from pathlib import Path +from urllib.error import URLError +from urllib.request import urlopen + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from scenarios.helpers import ( + assert_eq, + assert_ok, + fail, + info, + run_cmd, + write_random_file, +) + +ANSI_RE = re.compile(r"\x1b\[[0-?]*[ -/]*[@-~]") +RAND_FILE_NAME = "random_file" +RAND_FILE_SIZE = 20 * 1024 * 1024 +RAND_FILE_SEED = 42 +ADD_DEADLINE_SECS = 240 +ADD_INTERVAL_SECS = 10 +ADD_ATTEMPT_TIMEOUT_SECS = 180 +RETRIEVAL_DEADLINE_SECS = 90 +RETRIEVAL_INTERVAL_SECS = 5 +RETRIEVAL_REQUEST_TIMEOUT_SECS = 10 +VERIFY_CID_SCRIPT = """ +import { readFileSync } from "node:fs"; +import { CID } from "multiformats"; +import { sha256 } from "multiformats/hashes/sha2"; + +const [cidString, filePath] = process.argv.slice(1); + +if (!cidString || !filePath) { + console.error("usage: node --input-type=module --eval