Add integration test for log limiter 24/285024/8
authorMarek Szulc <m.szulc3@samsung.com>
Wed, 30 Nov 2022 15:15:55 +0000 (16:15 +0100)
committerMichal Bloch <m.bloch@partner.samsung.com>
Wed, 21 Dec 2022 19:18:05 +0000 (19:18 +0000)
Change-Id: I951ececa259bed4a7aa5b2806dcdcc5e3aa40e89

tests/dlog_test.in

index 10e4f00..a022670 100644 (file)
@@ -955,6 +955,24 @@ if [ "$TEST_DYNAMIC_FILTERS" = "true" ] && [ "$type" != "zero-copy" ]; then # No
                dlog_logger -t 0 &
                LOGGER=$!
                sleep 1
+
+               # limiter test (the feature allows to enable/disable particular log type)
+               dlogsend -c 11 -d 1 -t QWE blabla &
+
+               sleep 0.5
+               dlogctl -t QWE -s deny
+               LOG_DETAILS="testing if log limiter works (deny) (1/3)"
+               [ "$(dlogutil -d QWE | wc -l)" -eq 1 ] && ok || fail
+               sleep 6
+               LOG_DETAILS="testing if log limiter works (deny) (2/3)"
+               [ "$(dlogutil -d QWE | wc -l)" -eq 1 ] && ok || fail
+
+               dlogctl -t QWE -s allow
+               sleep 4
+               LOG_DETAILS="testing if log limiter works (allow) (3/3)"
+               [ "$(dlogutil -d QWE | wc -l)" -eq 5 ] && ok || fail
+
+               dlogutil -c
        fi
 fi