Skip to content

Commit

Permalink
test: improve more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EsadCetiner authored Mar 8, 2024
1 parent 39b0ff0 commit ced50ee
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 287 deletions.
16 changes: 8 additions & 8 deletions tests/regression/roundcube-rule-exclusions-plugin/9519104.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ meta:
name: 9519104.yaml
tests:
- test_title: 9519104-1
desc: Disable 932236 for _token parameter, but only within a certain character range
desc: Disable 932236 for _token parameter
stages:
- stage:
input:
Expand All @@ -23,13 +23,13 @@ tests:
_task=login
_action=login
_timezone=Australia%2FSydney
_url:
_user: postmaster%40example.com
_pass: %3Cscript%3E
_url=empty
_user=postmaster%40example.com
_pass=%3Cscript%3E
output:
no_log_contains: id "932236"
- test_title: 9519104-2
desc: Disable 942450 for _token parameter, but only within a certain character range
desc: Disable 942450 for _token parameter
stages:
- stage:
input:
Expand All @@ -46,8 +46,8 @@ tests:
_task=login
_action=login
_timezone=Australia%2FSydney
_url:
_user: postmaster%40example.com
_pass: %3Cscript%3E
_url=empty
_user=postmaster%40example.com
_pass=%3Cscript%3E
output:
no_log_contains: id "942450"
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ tests:
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
port: 80
method: POST
uri: /post?_task=mail&_framed=1&_framed=1
uri: /post?_task=mail&_framed=1&_uid=9&_mbox=INBOX&_framed=1&_action=headers
output:
no_log_contains: id "921180"
227 changes: 29 additions & 198 deletions tests/regression/roundcube-rule-exclusions-plugin/9519114.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ meta:
name: 9519114.yaml
tests:
- test_title: 9519114-1
desc: Disable 921180 for ARGS_NAMES:_id sending an email
desc: Sending an email
stages:
- stage:
input:
Expand All @@ -15,203 +15,34 @@ tests:
Host: localhost
User-Agent: Roundcube rule exclusions plugin
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/x-www-form-urlencoded
port: 80
method: POST
uri: /post?_task=mail&_action=send&_id=1&_id=2
uri: /post?_task=mail&_unlock=loading1709858237830&_framed=1
data: |
_token=random
_task=mail
_action=send
_id=106014434365ea5da745fb3
_attachments=empty
_from=1
[email protected],
_cc=empty
_bcc=

Check warning on line 31 in tests/regression/roundcube-rule-exclusions-plugin/9519114.yaml

View workflow job for this annotation

GitHub Actions / plugin-lint / check-syntax

31:20 [trailing-spaces] trailing spaces
_replyto=empty
_followupto=empty
_subject=<script>
_draft_saveid=empty
_draft=empty
_is_html=0
_framed=1
_message=<script>
editorSelector=plain
_mdn=empty

Check failure on line 41 in tests/regression/roundcube-rule-exclusions-plugin/9519114.yaml

View workflow job for this annotation

GitHub Actions / plugin-lint / check-syntax

41:14 syntax error: expected <block end>, but found '<scalar>' (syntax)
_dsn=empty
_keepformatting=empty
_priority=0
_store_target=Sent
output:
no_log_contains: id "921180"
- test_title: 9519114-2
desc: Disable 921180 for ARGS_NAMES:_id composing an email
stages:
- stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
User-Agent: Roundcube rule exclusions plugin
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
port: 80
method: POST
uri: /post?_task=mail&_action=compose&_id=1&_id=2
output:
no_log_contains: id "921180"
- test_title: 9519114-3
desc: Disable 921180 for ARGS_NAMES:_framed sending an email
stages:
- stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
User-Agent: Roundcube rule exclusions plugin
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
port: 80
method: POST
uri: /post?_task=mail&_action=send&_framed=1&_framed=2
output:
no_log_contains: id "921180"
- test_title: 9519114-4
desc: Disable 921180 for ARGS_NAMES:_framed composing an email
stages:
- stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
User-Agent: Roundcube rule exclusions plugin
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
port: 80
method: POST
uri: /post?_task=mail&_action=compose&_framed=1&_framed=2
output:
no_log_contains: id "921180"
- test_title: 9519114-5
desc: Disable 921180 for ARGS_NAMES:_task sending an email
stages:
- stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
User-Agent: Roundcube rule exclusions plugin
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
port: 80
method: POST
uri: /post?_task=mail&_action=send&_task=mail
output:
no_log_contains: id "921180"
- test_title: 9519114-6
desc: Disable 921180 for ARGS_NAMES:_task composing an email
stages:
- stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
User-Agent: Roundcube rule exclusions plugin
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
port: 80
method: POST
uri: /post?_task=mail&_action=compose&_task=mail
output:
no_log_contains: id "921180"
- test_title: 9519114-7
desc: Disable 921180 for ARGS_NAMES:_action sending an email
stages:
- stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
User-Agent: Roundcube rule exclusions plugin
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
port: 80
method: POST
uri: /post?_task=mail&_action=send&_action=send
output:
no_log_contains: id "921180"
- test_title: 9519114-8
desc: Disable 921180 for ARGS_NAMES:_action composing an email
stages:
- stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
User-Agent: Roundcube rule exclusions plugin
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
port: 80
method: POST
uri: /post?_task=mail&_action=compose&_action=compose
output:
no_log_contains: id "921180"
- test_title: 9519114-9
desc: Disable 942131 for destination email address when composing email
stages:
- stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
User-Agent: Roundcube rule exclusions plugin
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
port: 80
method: POST
uri: /post?_task=mail&_action=compose&_to=Postmaster%20<[email protected]>,
output:
no_log_contains: id "942131"
- test_title: 9519114-10
desc: Disable 942131 for destination email address when sending email
stages:
- stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
User-Agent: Roundcube rule exclusions plugin
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
port: 80
method: POST
uri: /post?_task=mail&_action=send&_to=Postmaster%20<[email protected]>,
output:
no_log_contains: id "942131"
- test_title: 9519114-11
desc: Disable CRS for email subject sending an email
stages:
- stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
User-Agent: Roundcube rule exclusions plugin
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
port: 80
method: POST
uri: /post?_task=mail&_action=send&_action=send&_subject=<script>
output:
no_log_contains: id "941101"
- test_title: 9519114-12
desc: Disable CRS for email subject composing an email
stages:
- stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
User-Agent: Roundcube rule exclusions plugin
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
port: 80
method: POST
uri: /post?_task=mail&_action=compose&_action=compose&_subject=<script>
output:
no_log_contains: id "941101"
- test_title: 9519114-13
desc: Disable CRS for email message sending an email
stages:
- stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
User-Agent: Roundcube rule exclusions plugin
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
port: 80
method: POST
uri: /post?_task=mail&_action=send&_action=send&_message=<script>
output:
no_log_contains: id "941101"
- test_title: 9519114-14
desc: Disable CRS for email message composing an email
stages:
- stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
User-Agent: Roundcube rule exclusions plugin
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
port: 80
method: POST
uri: /post?_task=mail&_action=compose&_action=compose&_message=<script>
output:
no_log_contains: id "941101"
no_log_contains: |
id "(?:921180|941101|942131)"
88 changes: 41 additions & 47 deletions tests/regression/roundcube-rule-exclusions-plugin/9519130.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ meta:
name: 9519130.yaml
tests:
- test_title: 9519130-1
desc: Disable 931130 for ARGS:_website[] when creating/modifying a contact
desc: Creating/modifying a contact
stages:
- stage:
input:
Expand All @@ -15,53 +15,47 @@ tests:
Host: localhost
User-Agent: Roundcube rule exclusions plugin
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/x-www-form-urlencoded
port: 80
method: POST
uri: /post?_task=addressbook&_website[]=https://example.com/
uri: /post?_task=addressbook&_framed=1&_orig_source=0
data: |
_token=random
_framed=1

Check failure on line 24 in tests/regression/roundcube-rule-exclusions-plugin/9519130.yaml

View workflow job for this annotation

GitHub Actions / plugin-lint / check-syntax

24:13 syntax error: could not find expected ':' (syntax)
_photo=-del-
_task=addressbook
_action=save
_framed=1
_source=0
_gid=0
_search=test
_cid=1test
_prefix=test
_firstname=Test
_middlename=test
_surname=Test
_suffix=test
_name=test
_nickname=test
_organization=test
_department=test
_jobtitle=test
_subtype_email[]=home
_email[]=test
_subtype_phone[]=home
_phone[]=test
_subtype_address[]=home
_street[]=test
_locality[]=test
_zipcode[]=test
_country[]=test
_region[]=test
_subtype_website[]=homepage
_website[]=https://example.com/
_subtype_im[]=aim
_im[]=https://example.com/
_gender=test
_birthday=test
_notes=test
output:
no_log_contains: id "931130"
- test_title: 9519130-2
desc: Disable 931130 for ARGS:_im[] when creating/modifying a contact
stages:
- stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
User-Agent: Roundcube rule exclusions plugin
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
port: 80
method: POST
uri: /post?_task=addressbook&_im[]=https://example.com/
output:
no_log_contains: id "931130"
- test_title: 9519130-3
desc: Disable 921180 for ARGS_NAMES:_framed, but only when viewing addressbook
stages:
- stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
User-Agent: Roundcube rule exclusions plugin
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
port: 80
method: POST
uri: /post?_task=addressbook&_framed=1&_framed=2
output:
no_log_contains: id "921180"
- test_title: 9519130-4
desc: Disable 921180 for ARGS_NAMES:_task, but only when viewing addressbook
stages:
- stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
User-Agent: Roundcube rule exclusions plugin
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
port: 80
method: POST
uri: /post?_task=addressbook&_task=addressbook
output:
no_log_contains: id "921180"
Loading

0 comments on commit ced50ee

Please sign in to comment.