-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #494 from pinheadmz/semver-bitcoin
- Loading branch information
Showing
13 changed files
with
147 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,8 +29,12 @@ jobs: | |
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
# test: [scenarios_test.py, rpc_test.py, graph_test.py, ln_test.py, dag_connection_test.py, logging_test.py] | ||
test: [scenarios_test.py, rpc_test.py, dag_connection_test.py, logging_test.py] | ||
test: | ||
- conf_test.py | ||
- dag_connection_test.py | ||
- logging_test.py | ||
- rpc_test.py | ||
- scenarios_test.py | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: azure/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import json | ||
import os | ||
import re | ||
from pathlib import Path | ||
|
||
from test_base import TestBase | ||
|
||
from warnet.k8s import get_mission | ||
|
||
|
||
class ConfTest(TestBase): | ||
def __init__(self): | ||
super().__init__() | ||
self.network_dir = Path(os.path.dirname(__file__)) / "data" / "bitcoin_conf" | ||
|
||
def run_test(self): | ||
try: | ||
self.setup_network() | ||
self.check_uacomment() | ||
finally: | ||
self.stop_server() | ||
|
||
def setup_network(self): | ||
self.log.info("Setting up network") | ||
self.log.info(self.warcli(f"deploy {self.network_dir}")) | ||
self.wait_for_all_tanks_status(target="running") | ||
|
||
def check_uacomment(self): | ||
tanks = get_mission("tank") | ||
|
||
def get_uacomment(): | ||
for tank in tanks[::-1]: | ||
try: | ||
name = tank.metadata.name | ||
info = json.loads(self.warcli(f"bitcoin rpc {name} getnetworkinfo")) | ||
subver = info["subversion"] | ||
|
||
# Regex pattern to match the uacomment inside parentheses | ||
# e.g. /Satoshi:27.0.0(tank-0027)/ | ||
pattern = r"\(([^)]+)\)" | ||
match = re.search(pattern, subver) | ||
if match: | ||
uacomment = match.group(1) | ||
assert uacomment == name | ||
else: | ||
return False | ||
except Exception: | ||
return False | ||
return True | ||
|
||
self.wait_for_predicate(get_uacomment) | ||
|
||
|
||
if __name__ == "__main__": | ||
test = ConfTest() | ||
test.run_test() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
nodes: | ||
- name: tank-0016 | ||
image: | ||
tag: "v0.16.1" | ||
connect: | ||
- tank-0017 | ||
config: | ||
uacomment=tank-0016 | ||
- name: tank-0017 | ||
image: | ||
tag: "v0.17.0" | ||
connect: | ||
- tank-0019 | ||
config: | ||
uacomment=tank-0017 | ||
- name: tank-0019 | ||
image: | ||
tag: "v0.19.2" | ||
connect: | ||
- tank-0020 | ||
config: | ||
uacomment=tank-0019 | ||
- name: tank-0020 | ||
image: | ||
tag: "v0.20.0" | ||
connect: | ||
- tank-0021 | ||
config: | ||
uacomment=tank-0020 | ||
- name: tank-0021 | ||
image: | ||
tag: "v0.21.1" | ||
connect: | ||
- tank-0024 | ||
config: | ||
uacomment=tank-0021 | ||
- name: tank-0024 | ||
image: | ||
tag: "24.2" | ||
connect: | ||
- tank-0025 | ||
config: | ||
uacomment=tank-0024 | ||
- name: tank-0025 | ||
image: | ||
tag: "25.1" | ||
connect: | ||
- tank-0026 | ||
config: | ||
uacomment=tank-0025 | ||
- name: tank-0026 | ||
image: | ||
tag: "26.0" | ||
connect: | ||
- tank-0027 | ||
config: | ||
uacomment=tank-0026 | ||
- name: tank-0027 | ||
image: | ||
tag: "27.0" | ||
connect: | ||
- tank-0016 | ||
config: | ||
uacomment=tank-0027 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
image: | ||
repository: bitcoindevproject/bitcoin | ||
pullPolicy: IfNotPresent | ||
tag: "27.0" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
Empty file.
Oops, something went wrong.