Skip to content

Commit 9a0e09b

Browse files
committed
Stricter ethd CI
1 parent a79c867 commit 9a0e09b

1 file changed

Lines changed: 87 additions & 56 deletions

File tree

.github/test-ethd-config.exp

Lines changed: 87 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -20,100 +20,132 @@ proc address {} {
2020
send "0xDccf8451070a86183eE70D330C4c43b686E9CF86\t\r"
2121
}
2222

23+
proc expect_or_fail {pattern procname {t ""}} {
24+
set old_timeout $::timeout
25+
if {$t ne ""} {
26+
set ::timeout $t
27+
}
28+
expect {
29+
$pattern {
30+
$procname
31+
}
32+
timeout {
33+
puts "Timeout waiting for: $pattern"
34+
exit 1
35+
}
36+
eof {
37+
puts "Unexpected EOF while waiting for: $pattern"
38+
exit 1
39+
}
40+
}
41+
set ::timeout $old_timeout
42+
}
43+
44+
proc expect_optional {pattern procname {t ""}} {
45+
set old_timeout $::timeout
46+
if {$t ne ""} {
47+
set ::timeout $t
48+
}
49+
expect {
50+
$pattern {
51+
$procname
52+
}
53+
timeout {}
54+
eof {
55+
puts "Unexpected EOF while waiting for optional: $pattern"
56+
exit 1
57+
}
58+
}
59+
set ::timeout $old_timeout
60+
}
61+
62+
proc expect_eof {{t ""}} {
63+
set old_timeout $::timeout
64+
if {$t ne ""} {
65+
set ::timeout $t
66+
}
67+
expect {
68+
eof {}
69+
timeout {
70+
if {$t ne ""} {
71+
puts "Timeout waiting for EOF"
72+
exit 1
73+
}
74+
}
75+
}
76+
set ::timeout $old_timeout
77+
}
78+
2379
proc default-deployment {} {
24-
global spawn_id
25-
expect "Select Network"
26-
accept_default
80+
expect_or_fail "Select Network" accept_default
2781

28-
expect "Select deployment type"
29-
accept_default
82+
expect_or_fail "Select deployment type" accept_default
3083

31-
expect "Select consensus client"
32-
accept_default
84+
expect_or_fail "Select consensus client" accept_default
3385

34-
expect "Select execution client"
35-
accept_default
86+
expect_or_fail "Select execution client" accept_default
3687
}
3788

3889
proc all-defaults {} {
39-
global spawn_id
4090
default-deployment
4191

42-
expect "Configure CL checkpoint sync URL"
43-
accept_default
92+
expect_or_fail "Configure CL checkpoint sync URL" accept_default
4493

45-
expect "MEV Boost"
46-
yes
94+
expect_or_fail "MEV Boost" yes
4795

48-
expect "Relays list"
49-
accept_default
96+
expect_or_fail "Relays list" accept_default
5097

51-
expect "Grafana"
52-
yes
98+
expect_optional "MEV Build Factor" yes 120
5399

54-
expect "Configure rewards address"
55-
address
100+
expect_or_fail "Grafana" yes
56101

57-
expect "Configure Graffiti"
58-
accept_default
102+
expect_or_fail "Configure rewards address" address
59103

60-
expect "Default Graffiti"
61-
yes
104+
expect_or_fail "Configure Graffiti" accept_default
62105

63-
expect EOF
106+
expect_or_fail "Default Graffiti" yes
107+
108+
expect_eof 300
64109
}
65110

66111
proc no-mev {} {
67-
global spawn_id
68112
default-deployment
69113

70-
expect "Configure CL checkpoint sync URL"
71-
accept_default
114+
expect_or_fail "Configure CL checkpoint sync URL" accept_default
72115

73-
expect "MEV Boost"
74-
no
116+
expect_or_fail "MEV Boost" no
75117

76-
expect "Grafana"
77-
yes
118+
expect_or_fail "Grafana" yes
78119

79-
expect "Configure rewards address"
80-
address
120+
expect_or_fail "Configure rewards address" accept_default
81121

82-
expect "Configure Graffiti"
83-
accept_default
122+
expect_or_fail "Configure Graffiti" accept_default
84123

85-
expect "Default Graffiti"
86-
yes
124+
expect_or_fail "Default Graffiti" yes
87125

88-
expect EOF
126+
expect_eof 300
89127
}
90128

91129
proc no-grafana {} {
92-
global spawn_id
93130
default-deployment
94131

95-
expect "Configure CL checkpoint sync URL"
96-
accept_default
132+
expect_or_fail "Configure CL checkpoint sync URL" accept_default
133+
134+
expect_or_fail "MEV Boost" yes
97135

98-
expect "MEV Boost"
99-
yes
136+
expect_or_fail "Relays list" accept_default
100137

101-
expect "Relays list"
102-
accept_default
138+
expect_optional "MEV Build Factor" yes
103139

104-
expect "Grafana"
105-
no
140+
expect_or_fail "Grafana" no
106141

107-
expect "Configure rewards address"
108-
address
142+
expect_or_fail "Configure rewards address" accept_default
109143

110-
expect "Configure Graffiti"
111-
accept_default
144+
expect_or_fail "Configure Graffiti" accept_default
112145

113-
expect "Default Graffiti"
114-
yes
146+
expect_or_fail "Default Graffiti" yes
115147

116-
expect EOF
148+
expect_eof 300
117149
}
118150

119151
set timeout 5
@@ -124,7 +156,6 @@ if {$argc > 0} {
124156
set action [lindex $argv 0]
125157
switch -- $action {
126158
"all-defaults" all-defaults
127-
"no-checkpoint" no-checkpoint
128159
"no-mev" no-mev
129160
"no-grafana" no-grafana
130161
default { puts "Unknown action: $action"; exit 1 }

0 commit comments

Comments
 (0)