#1 Initial unit test
Merged 3 years ago by tasleson. Opened 3 years ago by tasleson.
rpms/ tasleson/targetd ci_test  into  master

file added
+49
@@ -0,0 +1,49 @@ 

+ #!/usr/bin/bash

+ 

+ function _chk

+ {

+     echo "executing: $@"

+     eval "$@"

+     local rc=$?

+     if [ $rc -ne 0 ]; then

+         echo "Failed: $rc"

+         # Dump log for targetd

+         echo "journalctl -u targetd"

+         journalctl -u targetd

+ 

+         # On failure dump the audit logs

+         echo "ausearch ..."

+         ausearch -i -m avc,user_avc,selinux_err,user_selinux_err -ts recent

+         exit 1

+     fi

+ }

+ 

+ SOURCE_DIR="targetd_src"

+ BASE=$PWD

+ 

+ # TODO REMOVE THIS WHEN RAWHIDE PICKS UP

+ # https://github.com/fedora-selinux/selinux-policy-contrib/pull/334

+ _chk setenforce 0

+ 

+ # Run the upstream setup script

+ _chk cd $SOURCE_DIR

+ _chk ./test/test.sh setup

+ 

+ # Pick up new changes from setup

+ _chk systemctl restart targetd

+ 

+ # Try stopping the firewall, but don't fail if this fails

+ systemctl stop firewalld

+ 

+ # Give the service a moment to start up.

+ _chk sleep 10

+ 

+ # See if the daemon is up and accepting ...

+ netstat -anp | grep LISTEN | grep 18700

+ 

+ # Go back to start directory and run unit test.

+ _chk cd $BASE

+ 

+ SRC="$BASE/$SOURCE_DIR"

+ _chk TARGETD_UT_CERTFILE=/etc/target/targetd_cert.pem PYTHONPATH=$SRC python3 $SRC/test/targetd_test.py -v

+ exit 0 

\ No newline at end of file

file added
+22
@@ -0,0 +1,22 @@ 

+ - hosts: localhost

+   roles:

+   - role: standard-test-basic

+     tags:

+     - classic

+     tests:

+     - simple:

+         dir: .

+         run: ./ci_test.sh

+     required_packages:

+     - targetd

+     - util-linux

+     - lvm2

+     - procps-ng

+     - coreutils

+     - openssl

+     - btrfs-progs

+     - audit

+     - python3-requests

+     repositories:

+     - repo: "https://github.com/open-iscsi/targetd.git"

+       dest: "targetd_src"

Initial take at adding a unit test for targetd.

Signed-off-by: Tony Asleson tasleson@redhat.com

rebased onto 30080ae

3 years ago

1 new commit added

  • Use different cert. path
3 years ago

1 new commit added

  • Do more in test script
3 years ago

1 new commit added

  • More debug & ideas for fixes
3 years ago

rebased onto 0e4618c

3 years ago

rebased onto f0ea229

3 years ago

rebased onto 8992b50

3 years ago

rebased onto 706d98c

3 years ago

Pull-Request has been merged by tasleson

3 years ago