@@ -125,7 +125,8 @@ TEST_P(TestVm, AlwaysApplyCanary) {
125
125
const std::string root_ids[2 ] = {" root_id_1" , " root_id_2" };
126
126
const std::string vm_ids[2 ] = {" vm_id_1" , " vm_id_2" };
127
127
const std::string vm_configs[2 ] = {" vm_config_1" , " vm_config_2" };
128
- const std::string plugin_configs[2 ] = {" plugin_config_1" , " plugin_config_2" };
128
+ const std::string plugin_configs[3 ] = {" plugin_config_1" , " plugin_config_2" ,
129
+ /* raising the error */ " " };
129
130
const std::string plugin_keys[2 ] = {" plugin_key_1" , " plugin_key_2" };
130
131
const auto fail_open = false ;
131
132
@@ -182,8 +183,8 @@ TEST_P(TestVm, AlwaysApplyCanary) {
182
183
for (const auto &root_id : root_ids) {
183
184
for (const auto &vm_id : vm_ids) {
184
185
for (const auto &vm_config : vm_configs) {
185
- for (const auto &plugin_config : plugin_configs ) {
186
- for (const auto &plugin_key : plugin_keys ) {
186
+ for (const auto &plugin_key : plugin_keys ) {
187
+ for (const auto &plugin_config : plugin_configs ) {
187
188
canary_count = 0 ;
188
189
TestContext::resetGlobalLog ();
189
190
WasmHandleFactory wasm_handle_factory_comp =
@@ -199,6 +200,14 @@ TEST_P(TestVm, AlwaysApplyCanary) {
199
200
auto wasm_handle_comp =
200
201
createWasm (vm_key, source, plugin_comp, wasm_handle_factory_comp,
201
202
wasm_handle_clone_factory_for_canary, false );
203
+
204
+ if (plugin_config.empty ()) {
205
+ // configure_check.wasm should raise the error at `onConfigure` in canary when the
206
+ // `plugin_config` is empty string.
207
+ EXPECT_EQ (wasm_handle_comp, nullptr );
208
+ return ;
209
+ }
210
+
202
211
ASSERT_TRUE (wasm_handle_comp && wasm_handle_comp->wasm ());
203
212
204
213
EXPECT_TRUE (TestContext::isGlobalLogged (" onConfigure: " + root_id));
0 commit comments