Skip to content

Commit e3c9005

Browse files
committed
Test batcher restart in enclave
1 parent c4c1abd commit e3c9005

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

espresso/devnet-tests/batcher_restart_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,20 @@ import (
66

77
"github.com/ethereum/go-ethereum"
88
"github.com/stretchr/testify/require"
9+
10+
env "github.com/ethereum-optimism/optimism/espresso/environment"
911
)
1012

1113
func TestBatcherRestart(t *testing.T) {
14+
testRestart(t, false)
15+
}
16+
17+
func TestEnclaveRestart(t *testing.T) {
18+
env.RunOnlyWithEnclave(t)
19+
testRestart(t, true)
20+
}
21+
22+
func testRestart(t *testing.T, tee bool) {
1223
ctx, cancel := context.WithCancel(context.Background())
1324
defer cancel()
1425

@@ -18,6 +29,8 @@ func TestBatcherRestart(t *testing.T) {
1829
require.NoError(t, d.Down())
1930
}()
2031

32+
d.tee = tee
33+
2134
// Send a transaction just to check that everything has started up ok.
2235
require.NoError(t, d.RunSimpleL2Burn())
2336

espresso/devnet-tests/devnet_tools.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import (
3333

3434
type Devnet struct {
3535
ctx context.Context
36+
tee bool
3637
secrets secrets.Secrets
3738
outageTime time.Duration
3839
successTime time.Duration
@@ -81,9 +82,16 @@ func NewDevnet(ctx context.Context, t *testing.T) *Devnet {
8182
}
8283

8384
func (d *Devnet) Up() (err error) {
85+
var profile string
86+
if d.tee {
87+
profile = "tee"
88+
} else {
89+
profile = "default"
90+
}
91+
8492
cmd := exec.CommandContext(
8593
d.ctx,
86-
"docker", "compose", "up", "-d",
94+
"docker", "compose", "--profile", profile, "up", "-d",
8795
)
8896
cmd.Env = append(
8997
cmd.Env,

0 commit comments

Comments
 (0)