-
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.
charts: only use conf file sections prior to v0.17
- Loading branch information
Showing
7 changed files
with
142 additions
and
3 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
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 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" |