e3cccd3 test: make the resolved notifications check a bit more robust

Authored and Committed by mrc0mmand 2 years ago
    test: make the resolved notifications check a bit more robust
    
    Let's parse the resolved JSON notifications via `jq` and check them in a
    bit more "controlled" manner - e.g. until now the `grep` was checking just
    a one gigantic JSON string, as all received notifications via the
    varlink socket are terminated by a NUL character, not a newline.
    
    Also, as the notification delivery is asynchronous, retry the check
    a couple of times if it fails (spotted in C8S jobs):
    
    ```
    [ 2891.935879] testsuite-75.sh[36]: + : '--- nss-resolve/nss-myhostname tests'
    [ 2891.935988] testsuite-75.sh[36]: + run getent -s resolve hosts ns1.unsigned.test
    [ 2891.936542] testsuite-75.sh[177]: + getent -s resolve hosts ns1.unsigned.test
    [ 2891.937499] testsuite-75.sh[178]: + tee /tmp/tmp.pqjNvbQ2eS
    [ 2891.939977] testsuite-75.sh[178]: 10.0.0.1        ns1.unsigned.test
    [ 2891.940258] testsuite-75.sh[36]: + grep -qE '^10\.0\.0\.1\s+ns1\.unsigned\.test' /tmp/tmp.pqjNvbQ2eS
    [ 2891.942235] testsuite-75.sh[189]: + grep -qF '[10,0,0,1]'
    [ 2891.942577] testsuite-75.sh[188]: + grep -aF ns1.unsigned.test /tmp/notifications.txt
    [ 2891.943978] systemd[1]: testsuite-75.service: Child 36 belongs to testsuite-75.service.
    [ 2891.944112] systemd[1]: testsuite-75.service: Main process exited, code=exited, status=1/FAILURE
    [ 2891.944215] systemd[1]: testsuite-75.service: Failed with result 'exit-code'.
    ```
    
        
file modified
+64 -5