Skip to content

Commit 0426b02

Browse files
authored
Fix Ed25519 public key extraction and improve Trap test robustness
1 parent f53b98a commit 0426b02

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

.github/workflows/format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ jobs:
151151
--config clang-tidy
152152
--define engine=multi
153153
--disk_cache /tmp/bazel/cache
154-
--copt=-DPROXY_WASM_VERIFY_WITH_ED25519_PUBKEY=\"$(xxd -p -c 256 test/test_data/signature_key1.pub | cut -b9-)\"
154+
--copt=-DPROXY_WASM_VERIFY_WITH_ED25519_PUBKEY=\"$(xxd -p -c 256 test/test_data/signature_key1.pub | cut -c3-)\"
155155
//...
156156
157157
- name: save bazel cache

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ jobs:
363363
--define engine=${{ matrix.engine }}
364364
--disk_cache /tmp/bazel/cache
365365
${{ matrix.flags }}
366-
--per_file_copt=src/signature_util.cc,test/signature_util_test.cc@-DPROXY_WASM_VERIFY_WITH_ED25519_PUBKEY=\"$(xxd -p -c 256 test/test_data/signature_key1.pub | cut -b9-)\"
366+
--per_file_copt=src/signature_util.cc,test/signature_util_test.cc@-DPROXY_WASM_VERIFY_WITH_ED25519_PUBKEY=\"$(xxd -p -c 256 test/test_data/signature_key1.pub | cut -c3-)\"
367367
//test:signature_util_test
368368
369369
- name: remove unaccessed files from cache

test/runtime_test.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,10 @@ TEST_P(TestVm, Trap) {
158158
if (engine_ == "v8") {
159159
EXPECT_TRUE(host->isErrorLogged("Proxy-Wasm plugin in-VM backtrace:"));
160160
EXPECT_TRUE(host->isErrorLogged(" - std::panicking::begin_panic"));
161-
EXPECT_TRUE(host->isErrorLogged(" - _wasm_trap_wasm::one"));
161+
// Check for the function name 'one' in the backtrace, which may appear with or without
162+
// module prefix depending on Rust compiler version and symbol generation.
163+
bool has_one_symbol = host->isErrorLogged("::one") || host->isErrorLogged(" - one");
164+
EXPECT_TRUE(has_one_symbol) << "Expected to find '::one' or ' - one' in backtrace";
162165
}
163166
}
164167

0 commit comments

Comments
 (0)