Browse Source

Merge pull request #4 from kamailio/exclude_units

ktestsctl: optionally exclude list of units per OS
Giacomo Vacca 7 years ago
parent
commit
6d962feb17
6 changed files with 15 additions and 1 deletions
  1. 6 0
      README.md
  2. 1 0
      docker/Dockerfile.centos7
  3. 1 0
      docker/Dockerfile.debian9
  4. 1 0
      etc/excludeunits.txt.centos7
  5. 0 0
      etc/excludeunits.txt.debian9
  6. 6 1
      ktestsctl

+ 6 - 0
README.md

@@ -153,6 +153,12 @@ docker ps
 docker stop <containerid>
 ```
 
+### Excluding Units ###
+
+You can exclude some units to be launched by listing them, one per line, in
+`etc/excludeunits.txt.DISTRIBUTION` (e.g. `etc/excludeunits.txt.centos7`),
+and then rebuilding the image.
+
 ## Contributing ##
 
 Contributions are more than welcome, recommended way is to do pull requests.

+ 1 - 0
docker/Dockerfile.centos7

@@ -58,6 +58,7 @@ ENV DBROOTPW=ktestsrootpw
 RUN mysql_install_db --user=mysql
 
 COPY kamailio-tests /usr/local/src/kamailio-tests
+COPY kamailio-tests/etc/excludeunits.txt.centos7 /usr/local/src/kamailio-tests/excludeunits.txt
 WORKDIR /usr/local/src/kamailio-tests
 
 ENTRYPOINT ["/usr/local/src/kamailio-tests/ktestsctl"]

+ 1 - 0
docker/Dockerfile.debian9

@@ -98,6 +98,7 @@ ENV DBRWPW=kamailiorw
 ENV DBROOTPW=ktestsrootpw
 
 COPY kamailio-tests /usr/local/src/kamailio-tests
+COPY kamailio-tests/etc/excludeunits.txt.debian9 /usr/local/src/kamailio-tests/excludeunits.txt
 WORKDIR /usr/local/src/kamailio-tests
 
 ENTRYPOINT ["/usr/local/src/kamailio-tests/ktestsctl"]

+ 1 - 0
etc/excludeunits.txt.centos7

@@ -0,0 +1 @@
+tphonu0001

+ 0 - 0
etc/excludeunits.txt.debian9


+ 6 - 1
ktestsctl

@@ -3,7 +3,7 @@
 . etc/config
 
 ### version for this script
-VERSION='1.0.0'
+VERSION='1.0.1'
 LOGDATE=`date`
 
 ktestsctl_usage() {
@@ -76,6 +76,11 @@ ktestsrun() {
 		UNITSLIST=`find units/${1}* -maxdepth 1 -type d`
 	fi
 	for tdir in ${UNITSLIST} ; do
+		if [[ ${tdir} =~ $(echo ^units\/\($(paste -sd'|' excludeunits.txt)\)$) ]]; then
+			echo
+			echo "Skipping ${tdir} as requested..."
+			continue
+		fi
 		if [[ -d "${tdir}" && ! -L "${tdir}" ]]; then
 			tname=`basename ${tdir}`
 			texec="${tname}.sh"