From: Vsevolod Stakhov Date: Fri, 15 Mar 2024 14:02:30 +0000 (+0000) Subject: [Test] More rework of the tests X-Git-Tag: 3.9.0~93^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fa4d299b3eeefd669d8e50f6ebb905fe251743cc;p=rspamd.git [Test] More rework of the tests --- diff --git a/test/functional/cases/150_rspamadm.robot b/test/functional/cases/150_rspamadm.robot index ba9bef5bd..6bff14b2e 100644 --- a/test/functional/cases/150_rspamadm.robot +++ b/test/functional/cases/150_rspamadm.robot @@ -1,8 +1,8 @@ *** Settings *** Suite Setup Rspamadm Setup Suite Teardown Rspamadm Teardown -Library Process -Library ../lib/rspamd.py +Library ${RSPAMD_TESTDIR}/lib/rspamd.py +Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot *** Test Cases *** Config Test @@ -46,20 +46,3 @@ Verbose mode Should Match Regexp ${result.stderr} ^$ Should Match Regexp ${result.stdout} hello world\n Should Be Equal As Integers ${result.rc} 0 - -*** Keywords *** -Rspamadm Setup - ${RSPAMADM_TMPDIR} = Make Temporary Directory - Set Suite Variable ${RSPAMADM_TMPDIR} - -Rspamadm Teardown - Cleanup Temporary Directory ${RSPAMADM_TMPDIR} - -Rspamadm - [Arguments] @{args} - ${result} = Run Process ${RSPAMADM} - ... --var\=TMPDIR\=${RSPAMADM_TMPDIR} - ... --var\=DBDIR\=${RSPAMADM_TMPDIR} - ... --var\=LOCAL_CONFDIR\=/nonexistent - ... @{args} - [Return] ${result} diff --git a/test/functional/lib/rspamd.robot b/test/functional/lib/rspamd.robot index a5f897365..f9614c6fa 100644 --- a/test/functional/lib/rspamd.robot +++ b/test/functional/lib/rspamd.robot @@ -289,6 +289,7 @@ Run Rspamd ... --var\=DBDIR\=${RSPAMD_TMPDIR} ... --var\=LOCAL_CONFDIR\=/non-existent ... --var\=CONFDIR\=${RSPAMD_TESTDIR}/../../conf/ + ... --insecure ... env:RSPAMD_LOCAL_CONFDIR=/non-existent ... env:RSPAMD_TMPDIR=${RSPAMD_TMPDIR} ... env:RSPAMD_CONFDIR=${RSPAMD_TESTDIR}/../../conf/ @@ -302,6 +303,21 @@ Run Rspamd # Confirm worker is reachable Wait Until Keyword Succeeds 15x 1 sec Ping Rspamd ${RSPAMD_LOCAL_ADDR} ${check_port} +Rspamadm Setup + ${RSPAMADM_TMPDIR} = Make Temporary Directory + Set Suite Variable ${RSPAMADM_TMPDIR} + +Rspamadm Teardown + Cleanup Temporary Directory ${RSPAMADM_TMPDIR} + +Rspamadm + [Arguments] @{args} + ${result} = Run Process ${RSPAMADM} + ... --var\=TMPDIR\=${RSPAMADM_TMPDIR} + ... --var\=DBDIR\=${RSPAMADM_TMPDIR} + ... --var\=LOCAL_CONFDIR\=/nonexistent + ... @{args} + [Return] ${result} Run Nginx ${template} = Get File ${RSPAMD_TESTDIR}/configs/nginx.conf diff --git a/test/functional/lib/vars.py b/test/functional/lib/vars.py index a4bcbadda..bee2e92d4 100644 --- a/test/functional/lib/vars.py +++ b/test/functional/lib/vars.py @@ -11,54 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. + import shutil import socket