소스 검색

[Test] Fighting with windmills in robot

tags/2.7
Vsevolod Stakhov 3 년 전
부모
커밋
d8a0164440
3개의 변경된 파일28개의 추가작업 그리고 8개의 파일을 삭제
  1. 13
    6
      src/libserver/composites.c
  2. 10
    1
      test/functional/cases/109_composites.robot
  3. 5
    1
      test/functional/configs/composites.conf

+ 13
- 6
src/libserver/composites.c 파일 보기

@@ -460,12 +460,19 @@ rspamd_composite_process_single_symbol (struct composites_data *cd,


if (!found) {
msg_debug_composites ("symbol %s in composite %s misses required option %s",
sym,
cd->composite->sym,
(cur_opt->type == RSPAMD_COMPOSITE_OPTION_PLAIN ?
cur_opt->data.match :
rspamd_regexp_get_pattern (cur_opt->data.re)));
if (cur_opt->type == RSPAMD_COMPOSITE_OPTION_PLAIN) {
msg_debug_composites ("symbol %s in composite %s misses required option %s",
sym,
cd->composite->sym,
cur_opt->data.match);
}
else {
msg_debug_composites ("symbol %s in composite %s failed to match regexp %s",
sym,
cd->composite->sym,
rspamd_regexp_get_pattern (cur_opt->data.re));
}

ms = NULL;

break;

+ 10
- 1
test/functional/cases/109_composites.robot 파일 보기

@@ -51,13 +51,22 @@ Composites - Opts RE Miss one
Scan File ${MESSAGE} opts=sym1,foo1
Expect Symbol With Score SYMOPTS1 5.00
Do Not Expect Symbol SYMOPTS2
Do Not Expect Symbol SYMOPTS3

Composites - Opts RE Miss both
Scan File ${MESSAGE} opts=sym2
Do Not Expect Symbol SYMOPTS1
Do Not Expect Symbol SYMOPTS2
Do Not Expect Symbol SYMOPTS3

Composites - Opts RE Hit
Scan File ${MESSAGE} opts=sym2,foo1
Scan File ${MESSAGE} opts=foo1,sym2
Expect Symbol With Score SYMOPTS2 6.00
Do Not Expect Symbol SYMOPTS1
Do Not Expect Symbol SYMOPTS3

Composites - Opts RE Hit 2
Scan File ${MESSAGE} opts=foo/,sym2
Expect Symbol With Score SYMOPTS3 6.00
Do Not Expect Symbol SYMOPTS2
Do Not Expect Symbol SYMOPTS1

+ 5
- 1
test/functional/configs/composites.conf 파일 보기

@@ -73,7 +73,11 @@ composites {
}

SYMOPTS2 {
expression = "OPTS[/foo.*/,sym2]";
expression = 'OPTS[/foo[0-9]/,sym2]';
score = 6.0;
}
SYMOPTS3 {
expression = 'OPTS[sym2,/FoO\\//i]';
score = 6.0;
}
}

Loading…
취소
저장