From f0c8fb41ce826d08a09b292509454605e99d5d84 Mon Sep 17 00:00:00 2001 From: sidey79 <7968127+sidey79@users.noreply.github.com> Date: Mon, 4 Mar 2019 23:06:05 +0100 Subject: [PATCH 1/3] test/test_SDWS07-definition.txt Added some basic tets for SD_WS07 Module, checks autocreate and pre defined Added Test which checks for bug #527 This test must be added to #531 to verify if the PR is complete --- Makefile | 1 + test/test_SDWS07-definition.txt | 67 +++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 test/test_SDWS07-definition.txt diff --git a/Makefile b/Makefile index 31bb93656..680e3d0e1 100644 --- a/Makefile +++ b/Makefile @@ -42,5 +42,6 @@ test: deploylocal test/test-runner.sh test_sub_SIGNALduino_OSV2 test/test-runner.sh test_sub_MCTFA test/test-runner.sh test_sub_SIGNALduino_getAttrDevelopment + test/test-runner.sh test_SDWS07 @echo === finished unit tests === sudo timeout 30 killall -vw perl || sudo killall -vws9 perl diff --git a/test/test_SDWS07-definition.txt b/test/test_SDWS07-definition.txt new file mode 100644 index 000000000..4f9afd5b8 --- /dev/null +++ b/test/test_SDWS07-definition.txt @@ -0,0 +1,67 @@ +defmod test_SDWS07 UnitTest dummyDuino ( +{ + CommandAttr(undef,"autocreate verbose 5"); + + my $sensorname="SD_WS07_TH_1"; + subtest "Check autocreate $sensorname" => sub { + plan tests => 3; + Dispatch($targetHash,"P7#6300C6F0B"); + ok(!IsDevice($sensorname), "check sensor not created with single dispatch"); + sleep 3; + Dispatch($targetHash,"P7#6300C6F0B"); + ok(IsDevice($sensorname), "check sensor created with second dispatch"); + CommandDelete(undef,$sensorname); + ok(!IsDevice($sensorname), "check sensor deleted correctly"); + }; + + sleep 3; + subtest "Check Dispatch() with existing definition only channel $sensorname" => sub { + plan tests => 4 ; + ok(!IsDevice($sensorname), "check sensor deleted correctly"); + CommandDefine(undef,"$sensorname SD_WS07 1"); + ok(IsDevice($sensorname), "check sensor not created with single dispatch"); + my $found=Dispatch($targetHash,"P7#6300C6F0B"); + is($found->[0],$sensorname,"Check if definition is found by dispatch()"); + CommandDelete(undef,$sensorname); + ok(!IsDevice($sensorname), "check sensor deleted correctly"); + + }; + + sleep 3; + subtest "Check Dispatch() with existing definition model_channel $sensorname" => sub { + plan tests => 4; + ok(!IsDevice($sensorname), "check sensor deleted correctly"); + + CommandDefine(undef,"$sensorname SD_WS07 SD_WS07_TH_1"); + ok(IsDevice($sensorname), "check sensor not created with single dispatch"); + my $found=Dispatch($targetHash,"P7#6300C6F0B"); + TODO: { + local $TODO="This bug must be fixed"; + is($found->[0],$sensorname,"Check if definition is found by dispatch()") || diag(explain $found); + }; + CommandDelete(undef,$sensorname); + ok(!IsDevice($sensorname), "check sensor deleted correctly"); + }; + + + $sensorname="SD_WS07_TH_631"; + sleep 3; + subtest "Check autocreate with longid $sensorname" => sub { + CommandAttr(undef,"$target longids 1"); + plan tests => 3; + + Dispatch($targetHash,"P7#6300C6F0B"); + ok(!IsDevice($sensorname), "check sensor not created with single dispatch"); + sleep 4; + Dispatch($targetHash,"P7#6300C6F0B"); + ok(IsDevice($sensorname), "check sensor created with second dispatch"); + sleep 1; + my $found=Dispatch($targetHash,"P7#6300C6F0B"); + is($found->[0],$sensorname,"Check if definition is found by dispatch()") || diag(explain $found); + CommandDelete(undef,$sensorname); + ok(!IsDevice($sensorname), "check sensor deleted correctly"); + CommandDeleteAttr(undef,"$target longids"); + }; + +} +) \ No newline at end of file From 646a272d3bce1d20375b5627d36ad95f37288268 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Mon, 4 Mar 2019 22:09:31 +0000 Subject: [PATCH 2/3] Travis automatic update controls file. Build (1291) [skip ci] --- controls_signalduino.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/controls_signalduino.txt b/controls_signalduino.txt index 4ba0a8d05..ba27c6bb7 100644 --- a/controls_signalduino.txt +++ b/controls_signalduino.txt @@ -1,4 +1,4 @@ -UPD 2019-03-04_21:01:58 198393 FHEM/00_SIGNALduino.pm +UPD 2019-03-04_21:39:40 198393 FHEM/00_SIGNALduino.pm UPD 2017-06-23_17:43:38 14541 FHEM/10_FS10.pm UPD 2016-09-18_21:22:06 10111 FHEM/14_BresserTemeo.pm UPD 2018-11-11_22:35:33 13616 FHEM/14_FLAMINGO.pm @@ -14,8 +14,8 @@ UPD 2019-02-12_21:37:35 14297 FHEM/14_SD_WS_Maverick.pm UPD 2019-02-12_21:37:35 50246 FHEM/14_SD_WS.pm UPD 2018-07-04_21:56:16 37910 FHEM/41_OREGON.pm UPD 2019-02-24_22:56:57 17027 FHEM/90_SIGNALduino_un.pm -UPD 2019-03-04_20:59:46 122245 FHEM/lib/SD_ProtocolData.pm -UPD 2019-03-04_21:25:35 3221 FHEM/lib/SD_Protocols.pm +UPD 2019-03-04_21:39:40 122245 FHEM/lib/SD_ProtocolData.pm +UPD 2019-03-04_21:39:40 3221 FHEM/lib/SD_Protocols.pm MOV FHEM/firmware/SIGNALduino_nano328.hex unused MOV FHEM/firmware/SIGNALduino_nanoCC1101.hex unused MOV FHEM/firmware/SIGNALduino_promini328.hex unused From a953f97353bc1836119f2def61804ac7c0287abd Mon Sep 17 00:00:00 2001 From: sidey79 <7968127+sidey79@users.noreply.github.com> Date: Mon, 4 Mar 2019 23:12:13 +0100 Subject: [PATCH 3/3] test/test_SDWS07-definition.txt Fixed number of expected tests for subtest --- test/test_SDWS07-definition.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_SDWS07-definition.txt b/test/test_SDWS07-definition.txt index 4f9afd5b8..c421eb75f 100644 --- a/test/test_SDWS07-definition.txt +++ b/test/test_SDWS07-definition.txt @@ -48,7 +48,7 @@ defmod test_SDWS07 UnitTest dummyDuino ( sleep 3; subtest "Check autocreate with longid $sensorname" => sub { CommandAttr(undef,"$target longids 1"); - plan tests => 3; + plan tests => 4; Dispatch($targetHash,"P7#6300C6F0B"); ok(!IsDevice($sensorname), "check sensor not created with single dispatch");