File tree 7 files changed +142
-3
lines changed
resources/charts/bitcoincore
7 files changed +142
-3
lines changed Original file line number Diff line number Diff line change 30
30
strategy :
31
31
matrix :
32
32
test :
33
+ - conf_test.py
33
34
- dag_connection_test.py
34
35
- logging_test.py
35
36
- rpc_test.py
Original file line number Diff line number Diff line change @@ -55,3 +55,15 @@ Create the name of the service account to use
55
55
{ {- default " default" .Values.serviceAccount.name } }
56
56
{ {- end } }
57
57
{ {- end } }
58
+
59
+
60
+ { {/*
61
+ Add network section heading in bitcoin.conf after v0.17.0
62
+ */} }
63
+ { {- define " bitcoincore.check_semver.regtest" -} }
64
+ { {- $tag := .Values.image.tag | trimPrefix " v" -} }
65
+ { {- $version := semverCompare " >=0.17.0" $tag -} }
66
+ { {- if $version -} }
67
+ [regtest]
68
+ { {- end -} }
69
+ { {- end -} }
Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ metadata:
7
7
data :
8
8
bitcoin.conf : |
9
9
{{- if eq .Values.chain "regtest" }}
10
+ regtest=1
11
+
12
+ {{ template "bitcoincore.check_semver.regtest" . }}
10
13
{{- tpl .Values.regtestConfig . | nindent 4 }}
11
14
{{- end }}
12
15
{{- .Values.baseConfig | nindent 4 }}
Original file line number Diff line number Diff line change @@ -111,9 +111,6 @@ metricsExport: false
111
111
prometheusMetricsPort : 9332
112
112
113
113
regtestConfig : |
114
- regtest=1
115
-
116
- [regtest]
117
114
rpcuser=user
118
115
rpcpassword=password
119
116
rpcport=18443
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python3
2
+
3
+ import json
4
+ import os
5
+ import re
6
+ from pathlib import Path
7
+
8
+ from test_base import TestBase
9
+
10
+ from warnet .k8s import get_mission
11
+
12
+
13
+ class ConfTest (TestBase ):
14
+ def __init__ (self ):
15
+ super ().__init__ ()
16
+ self .network_dir = Path (os .path .dirname (__file__ )) / "data" / "bitcoin_conf"
17
+
18
+ def run_test (self ):
19
+ try :
20
+ self .setup_network ()
21
+ self .check_uacomment ()
22
+ finally :
23
+ self .stop_server ()
24
+
25
+ def setup_network (self ):
26
+ self .log .info ("Setting up network" )
27
+ self .log .info (self .warcli (f"deploy { self .network_dir } " ))
28
+ self .wait_for_all_tanks_status (target = "running" )
29
+
30
+ def check_uacomment (self ):
31
+ tanks = get_mission ("tank" )
32
+
33
+ def get_uacomment ():
34
+ for tank in tanks [::- 1 ]:
35
+ try :
36
+ name = tank .metadata .name
37
+ info = json .loads (self .warcli (f"bitcoin rpc { name } getnetworkinfo" ))
38
+ subver = info ["subversion" ]
39
+
40
+ # Regex pattern to match the uacomment inside parentheses
41
+ # e.g. /Satoshi:27.0.0(tank-0027)/
42
+ pattern = r"\(([^)]+)\)"
43
+ match = re .search (pattern , subver )
44
+ if match :
45
+ uacomment = match .group (1 )
46
+ assert uacomment == name
47
+ else :
48
+ return False
49
+ except Exception :
50
+ return False
51
+ return True
52
+
53
+ self .wait_for_predicate (get_uacomment )
54
+
55
+
56
+ if __name__ == "__main__" :
57
+ test = ConfTest ()
58
+ test .run_test ()
Original file line number Diff line number Diff line change
1
+ nodes :
2
+ - name : tank-0016
3
+ image :
4
+ tag : " v0.16.1"
5
+ connect :
6
+ - tank-0017
7
+ config :
8
+ uacomment=tank-0016
9
+ - name : tank-0017
10
+ image :
11
+ tag : " v0.17.0"
12
+ connect :
13
+ - tank-0019
14
+ config :
15
+ uacomment=tank-0017
16
+ - name : tank-0019
17
+ image :
18
+ tag : " v0.19.2"
19
+ connect :
20
+ - tank-0020
21
+ config :
22
+ uacomment=tank-0019
23
+ - name : tank-0020
24
+ image :
25
+ tag : " v0.20.0"
26
+ connect :
27
+ - tank-0021
28
+ config :
29
+ uacomment=tank-0020
30
+ - name : tank-0021
31
+ image :
32
+ tag : " v0.21.1"
33
+ connect :
34
+ - tank-0024
35
+ config :
36
+ uacomment=tank-0021
37
+ - name : tank-0024
38
+ image :
39
+ tag : " 24.2"
40
+ connect :
41
+ - tank-0025
42
+ config :
43
+ uacomment=tank-0024
44
+ - name : tank-0025
45
+ image :
46
+ tag : " 25.1"
47
+ connect :
48
+ - tank-0026
49
+ config :
50
+ uacomment=tank-0025
51
+ - name : tank-0026
52
+ image :
53
+ tag : " 26.0"
54
+ connect :
55
+ - tank-0027
56
+ config :
57
+ uacomment=tank-0026
58
+ - name : tank-0027
59
+ image :
60
+ tag : " 27.0"
61
+ connect :
62
+ - tank-0016
63
+ config :
64
+ uacomment=tank-0027
Original file line number Diff line number Diff line change
1
+ image :
2
+ repository : bitcoindevproject/bitcoin
3
+ pullPolicy : IfNotPresent
4
+ tag : " 27.0"
You can’t perform that action at this time.
0 commit comments