Skip to content

Commit 488254e

Browse files
committed
Test batcher restart in enclave
1 parent 556fc2f commit 488254e

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
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: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import (
3434

3535
type Devnet struct {
3636
ctx context.Context
37+
tee bool
3738
secrets secrets.Secrets
3839
outageTime time.Duration
3940
successTime time.Duration
@@ -106,10 +107,15 @@ func (d *Devnet) Up() (err error) {
106107
// up any existing state.
107108
return fmt.Errorf("devnet is already running, this should be a clean state; please shut it down first")
108109
}
109-
110+
var profile string
111+
if d.tee {
112+
profile = "tee"
113+
} else {
114+
profile = "default"
115+
}
110116
cmd := exec.CommandContext(
111117
d.ctx,
112-
"docker", "compose", "up", "-d",
118+
"docker", "compose", "--profile", profile, "up", "-d",
113119
)
114120
cmd.Env = append(
115121
cmd.Env,

0 commit comments

Comments
 (0)