fix test case using rule from json file
This commit is contained in:
@@ -110,16 +110,13 @@ ip_plugin_accept_tag_match(struct ip_plugin_schema *schema,
|
||||
cJSON *tmp_obj = NULL;
|
||||
size_t n_tag = table_manager_accept_tags_count(schema->ref_tbl_mgr);
|
||||
|
||||
tmp_obj = cJSON_GetObjectItem(json, "tag");
|
||||
tmp_obj = cJSON_GetObjectItem(json, "effective_range");
|
||||
if (tmp_obj && n_tag > 0) {
|
||||
if (tmp_obj->type != cJSON_String) {
|
||||
log_fatal(logger, MODULE_IP_PLUGIN,
|
||||
"[%s:%d] ip_plugin table:<%s> has invalid tag format"
|
||||
" in line:%s", __FUNCTION__, __LINE__, table_name, cJSON_Print(json));
|
||||
return TAG_MATCH_ERR;
|
||||
}
|
||||
char *tag_str = cJSON_Print(tmp_obj);
|
||||
|
||||
int ret = table_manager_accept_tags_match(schema->ref_tbl_mgr, tmp_obj->valuestring);
|
||||
int ret = table_manager_accept_tags_match(schema->ref_tbl_mgr, tag_str);
|
||||
FREE(tag_str);
|
||||
|
||||
if (TAG_MATCH_ERR == ret) {
|
||||
log_fatal(logger, MODULE_IP_PLUGIN,
|
||||
"[%s:%d] ip_plugin table:<%s> has invalid tag format"
|
||||
|
||||
Reference in New Issue
Block a user