Repository: nexdatas/sardana-nxs-filerecorder (language: python)

Issue:
Add debian 11 tests
I would be good to add debian11 tests.


Discussion / hints:

Fix patch:
diff --git a/.ci/debian11_py3/Dockerfile b/.ci/debian11_py3/Dockerfile
new file mode 100644
index 0000000..0e27dda
--- /dev/null
+++ b/.ci/debian11_py3/Dockerfile
@@ -0,0 +1,22 @@
+FROM debian:bullseye
+
+MAINTAINER DESY, Jan Kotanski <jankotan@gmail.com>
+RUN /bin/bash -c 'echo "deb http://ftp.de.debian.org/debian bullseye main" > /etc/apt/sources.list.d/debiande.list'
+RUN apt-get update
+RUN apt-get install -y base-passwd
+RUN apt-get -qq update && apt-get -qq install -y libterm-readline-gnu-perl software-properties-common coreutils gnupg2 procps apt-utils curl apt-transport-https gnupg2 ca-certificates wget
+RUN wget --retry-connrefused http://repos.pni-hdri.de/debian_repo.pub.gpg
+RUN apt-key add debian_repo.pub.gpg
+RUN add-apt-repository "deb http://repos.pni-hdri.de/apt/debian bullseye main" -y
+RUN apt-get -qq update && apt-get -qq -y dist-upgrade
+RUN apt-get -qq update && apt-get -qq install -y default-mysql-client  python3-h5py  python3-mysqldb python3-sphinx  apt-utils debconf-utils net-tools  omniidl libomniorb4-dev libcos4-dev libomnithread4-dev libzmq3-dev python3-pninexus python3-lxml python3-h5py python3-pninexus python3-pyqt5.qtsvg python3-qtchecker  qtchooser
+RUN useradd -ms /bin/bash tango
+RUN  /bin/bash -c 'export DEBIAN_FRONTEND=noninteractive; debconf-set-selections <<< "mysql-server mysql-server/root_password password rootpw"; debconf-set-selections <<< "mysql-server mysql-server/root_password_again password rootpw"; debconf-set-selections <<< "mariadb-server mysql-server/root_password password rootpw"; debconf-set-selections <<< "mariadb-server mysql-server/root_password_again password rootpw"; debconf-get-selections |grep mysql '
+RUN apt-get -qq install -y default-mysql-server adduser
+RUN  /bin/bash -c 'sleep 10'
+RUN /bin/bash -c 'export DEBIAN_FRONTEND=noninteractive; debconf-set-selections <<< "tango-db tango-db/db/app-user string tango"; debconf-set-selections <<< "tango-db tango-db/mysql/app-pass	password rootpw"; debconf-set-selections <<< "tango-db tango-db/mysql/admin-pass password rootpw"; debconf-set-selections <<< "tango-db tango-db/password-confirm password rootpw"; debconf-set-selections <<< "tango-db tango-db/app-password-confirm password rootpw"; debconf-set-selections <<< "nxsconfigserver-db nxsconfigserver-db/mysql/app-pass password rootpw"; debconf-set-selections <<< "nxsconfigserver-db nxsconfigserver-db/mysql/admin-pass password rootpw"; debconf-set-selections <<< "nxsconfigserver-db nxsconfigserver-db/app-password-confirm password rootpw"; debconf-set-selections <<< "nxsconfigserver-db nxsconfigserver-db/db/app-user string tango"'
+
+ENV PKG_CONFIG_PATH=/home/tango/lib/pkgconfig
+ENV DISPLAY=":99.0"
+USER tango
+WORKDIR /home/tango
diff --git a/.ci/install.sh b/.ci/install.sh
index 8ce0278..76b43cd 100644
--- a/.ci/install.sh
+++ b/.ci/install.sh
@@ -1,140 +1,125 @@
 #!/usr/bin/env bash
 
 # workaround for incomatibility of default ubuntu 16.04 and tango configuration
-if [[ $1 == "ubuntu16.04" ]]; then
+if [[ "$1" == "ubuntu16.04" ]]; then
     docker exec  --user root ndts sed -i "s/\[mysqld\]/\[mysqld\]\nsql_mode = NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION/g" /etc/mysql/mysql.conf.d/mysqld.cnf
 fi
-if [ $1 = "ubuntu20.04" ]; then
+if [ "$1" = "ubuntu20.04" ]; then
     docker exec  --user root ndts sed -i "s/\[mysql\]/\[mysqld\]\nsql_mode = NO_ZERO_IN_DATE,NO_ENGINE_SUBSTITUTION\ncharacter_set_server=latin1\ncollation_server=latin1_swedish_ci\n\[mysql\]/g" /etc/mysql/mysql.conf.d/mysql.cnf
 fi
 
-echo "restart mysql"
-if [[ $1 == "debian9" ]]; then
-    # workaround for a bug in debian9, i.e. starting mysql hangs
-    docker exec  --user root ndts service mysql stop
-    docker exec  --user root ndts /bin/sh -c '$(service mysql start &) && sleep 30'
+# workaround for a bug in debian9, i.e. starting mysql hangs
+if [ "$1" = "debian11" ]; then
+    docker exec --user root ndts service mariadb restart
 else
-    docker exec  --user root ndts service mysql restart
-fi
-
-docker exec  --user root ndts /bin/sh -c 'export DEBIAN_FRONTEND=noninteractive; apt-get -qq update; apt-get -qq install -y   tango-db tango-common; sleep 10'
-if [ "$?" -ne "0" ]
-then
-    exit -1
+    docker exec --user root ndts service mysql stop
+    if [ "$1" = "ubuntu20.04" ] || [ "$1" = "ubuntu20.10" ] || [ "$1" = "ubuntu21.04" ]; then
+	# docker exec --user root ndts /bin/bash -c 'mkdir -p /var/lib/mysql'
+	# docker exec --user root ndts /bin/bash -c 'chown mysql:mysql /var/lib/mysql'
+	docker exec --user root ndts /bin/bash -c 'usermod -d /var/lib/mysql/ mysql'
+    fi
+    docker exec  --user root ndts /bin/bash -c '$(service mysql start &) && sleep 30'
 fi
 
-docker exec  --user root ndts /bin/bash -c 'export DEBIAN_FRONTEND=noninteractive; apt-get -qq update; apt-get -qq install -y xvfb  libxcb1 libx11-xcb1 libxcb-keysyms1 libxcb-image0 libxcb-icccm4 libxcb-render-util0 xkb-data'
-if [ "$?" -ne "0" ]; then exit -1; fi
+docker exec  --user root ndts /bin/bash -c 'export DEBIAN_FRONTEND=noninteractive; apt-get -qq update; apt-get -qq install -y xvfb  libxcb1 libx11-xcb1 libxcb-keysyms1 libxcb-image0 libxcb-icccm4 libxcb-render-util0 xkb-data tango-db tango-common; sleep 10'
+if [ "$?" -ne "0" ]; then exit 255; fi
 
 docker exec  --user root ndts mkdir -p /tmp/runtime-tango
 docker exec  --user root ndts chown -R tango:tango /tmp/runtime-tango
 
-if [ "$?" -ne "0" ]; then exit -1; fi
+if [ "$?" -ne "0" ]; then exit 255; fi
 echo "start Xvfb :99 -screen 0 1024x768x24 &"
 docker exec  --user root ndts /bin/bash -c 'export DISPLAY=":99.0"; Xvfb :99 -screen 0 1024x768x24 &'
-if [ "$?" -ne "0" ]; then exit -1; fi
+if [ "$?" -ne "0" ]; then exit 255; fi
 
 
 echo "install tango servers"
-docker exec  --user root ndts /bin/sh -c 'export DEBIAN_FRONTEND=noninteractive;  apt-get -qq update; apt-get -qq install -y  tango-starter tango-test liblog4j1.2-java git'
-if [ "$?" -ne "0" ]
-then
-    exit -1
-fi
+docker exec  --user root ndts /bin/bash -c 'export DEBIAN_FRONTEND=noninteractive;  apt-get -qq update; apt-get -qq install -y  tango-starter tango-test liblog4j1.2-java git'
+if [ "$?" -ne "0" ]; then exit 255; fi
 
 docker exec  --user root ndts service tango-db restart
 docker exec  --user root ndts service tango-starter restart
 
 
-if [[ $2 = "2" ]]; then
+if [[ "$2" = "2" ]]; then
     echo "install python-pytango"
-    docker exec  --user root ndts /bin/sh -c 'export DEBIAN_FRONTEND=noninteractive; apt-get -qq update; apt-get -qq install -y   python-pytango python-h5py  python-qtpy python-click git python-itango python-pint'
+    docker exec  --user root ndts /bin/bash -c 'export DEBIAN_FRONTEND=noninteractive; apt-get -qq update; apt-get -qq install -y   python-pytango python-h5py  python-qtpy python-click git python-itango python-pint'
 else
     echo "install python3-pytango"
     if [[ $1 == "debian9" ]]; then
-	docker exec  --user root ndts /bin/sh -c 'git clone https://github.com/hgrecco/pint pint-src; cd pint-src'
-	docker exec  --user root ndts /bin/sh -c 'cd pint-src; git checkout tags/0.8.1 -b b0.8.1; python3 setup.py install'
-	docker exec  --user root ndts /bin/sh -c 'git clone https://gitlab.com/tango-controls/itango  itango-src; cd itango-src'
-	docker exec  --user root ndts /bin/sh -c 'cd itango-src; git checkout tags/v0.1.7 -b b0.1.7; python3 setup.py install'
-	# docker exec  --user root ndts /bin/sh -c 'cd taurus-src; git checkout; python3 setup.py install'
+	docker exec  --user root ndts /bin/bash -c 'git clone https://github.com/hgrecco/pint pint-src; cd pint-src'
+	docker exec  --user root ndts /bin/bash -c 'cd pint-src; git checkout tags/0.8.1 -b b0.8.1; python3 setup.py install'
+	docker exec  --user root ndts /bin/bash -c 'git clone https://gitlab.com/tango-controls/itango  itango-src; cd itango-src'
+	docker exec  --user root ndts /bin/bash -c 'cd itango-src; git checkout tags/v0.1.7 -b b0.1.7; python3 setup.py install'
+	# docker exec  --user root ndts /bin/bash -c 'cd taurus-src; git checkout; python3 setup.py install'
     fi
-    if [ $1 = "ubuntu20.04" ]; then
-	docker exec  --user root ndts /bin/sh -c 'export DEBIAN_FRONTEND=noninteractive; apt-get -qq update; apt-get install -y git python3-six python3-numpy graphviz python3-sphinx g++ build-essential python3-dev pkg-config python3-all-dev  python3-setuptools libtango-dev python3-setuptools python3-tango python3-tz python3-enum34 python3ango; apt-get -qq install -y nxsconfigserver-db; sleep 10'
+    if [ "$1" = "debian10" ] || [ "$1" = "ubuntu20.04" ] || [ "$1" = "ubuntu20.10" ] || [ "$1" = "debian11" ] ; then
+	docker exec  --user root ndts /bin/bash -c 'export DEBIAN_FRONTEND=noninteractive; apt-get -qq update; apt-get install -y git python3-six python3-numpy graphviz python3-sphinx g++ build-essential python3-dev pkg-config python3-all-dev  python3-setuptools libtango-dev python3-setuptools python3-tango python3-tz python3-enum34 python3ango; apt-get -qq install -y nxsconfigserver-db; sleep 10'
     else
-	docker exec  --user root ndts /bin/sh -c 'export DEBIAN_FRONTEND=noninteractive; apt-get -qq update; apt-get install -y git python3-six python3-numpy graphviz python3-sphinx g++ build-essential python3-dev pkg-config python3-all-dev  python3-setuptools libtango-dev python3-setuptools python3-pytango python3-tz python3-enum34 python3ango; apt-get -qq install -y nxsconfigserver-db; sleep 10'
+	docker exec  --user root ndts /bin/bash -c 'export DEBIAN_FRONTEND=noninteractive; apt-get -qq update; apt-get install -y git python3-six python3-numpy graphviz python3-sphinx g++ build-essential python3-dev pkg-config python3-all-dev  python3-setuptools libtango-dev python3-setuptools python3-pytango python3-tz python3-enum34 python3ango; apt-get -qq install -y nxsconfigserver-db; sleep 10'
     fi
-    docker exec  --user root ndts /bin/sh -c 'export DEBIAN_FRONTEND=noninteractive; apt-get -qq update; apt-get install -y libboost-python-dev libboost-dev python3-h5py python3-qtpy  python3-click python3-setuptools  python3-pint'
-    if [[ $1 = "debian10" ]]; then
-	echo " "
-    elif [[ $1 == "ubuntu20.04" ]]; then
+    docker exec  --user root ndts /bin/bash -c 'export DEBIAN_FRONTEND=noninteractive; apt-get -qq update; apt-get install -y libboost-python-dev libboost-dev python3-h5py python3-qtpy  python3-click python3-setuptools  python3-pint'
+    if [ "$1" = "ubuntu20.04" ] || [ "$1" = "ubuntu20.10" ] || [ "$1" = "ubuntu21.04" ] || [ "$1" = "debian11" ] || [ "$1" = "debian10" ]; then
 	echo " "
     else
-	docker exec  --user root ndts /bin/sh -c 'export DEBIAN_FRONTEND=noninteractive; apt-get -qq update; apt-get install -y libtango-dev python3-dev'
-	docker exec  --user root ndts /bin/sh -c 'git clone https://gitlab.com/tango-controls/pytango pytango; cd pytango; git checkout tags/v9.2.5 -b b9.2.5'
-	docker exec  --user root ndts /bin/sh -c 'cd pytango; python3 setup.py install'
+	docker exec  --user root ndts /bin/bash -c 'export DEBIAN_FRONTEND=noninteractive; apt-get -qq update; apt-get install -y libtango-dev python3-dev'
+	docker exec  --user root ndts /bin/bash -c 'git clone https://gitlab.com/tango-controls/pytango pytango; cd pytango; git checkout tags/v9.2.5 -b b9.2.5'
+	docker exec  --user root ndts /bin/bash -c 'cd pytango; python3 setup.py install'
     fi
 fi
-if [ "$?" -ne "0" ]
-then
-    exit -1
-fi
+if [ "$?" -ne "0" ]; then exit 255; fi
 
 echo "install qt5"
-docker exec  --user root ndts /bin/sh -c 'export DEBIAN_FRONTEND=noninteractive;  apt-get -qq update; apt-get -qq install -y  qtbase5-dev-tools qt5-default'
-if [ "$?" -ne "0" ]
-then
-    exit -1
+if [[ "$1" == "debian11" ]]; then
+    docker exec  --user root ndts /bin/bash -c 'export DEBIAN_FRONTEND=noninteractive;  apt-get -qq update; apt-get -qq install -y  qtbase5-dev-tools'
+else
+    docker exec  --user root ndts /bin/bash -c 'export DEBIAN_FRONTEND=noninteractive;  apt-get -qq update; apt-get -qq install -y  qtbase5-dev-tools qt5-default'
 fi
+if [ "$?" -ne "0" ]; then exit 255; fi
 
-if [[ $1 == "debian8" ]]; then
-    if [[ $2 == "3" ]]; then
+if [[ "$1" == "debian8" ]]; then
+    if [[ "$2" == "3" ]]; then
 	echo "install python3-mysqldb"
-	docker exec  --user root ndts /bin/sh -c 'export DEBIAN_FRONTEND=noninteractive; apt-get -qq update; apt-get install -y -t=jessie-backports  python3-mysqldb'
+	docker exec  --user root ndts /bin/bash -c 'export DEBIAN_FRONTEND=noninteractive; apt-get -qq update; apt-get install -y -t=jessie-backports  python3-mysqldb'
     fi
 fi
 
-if [[ $2 == "2" ]]; then
+if [[ "$2" == "2" ]]; then
     echo "install sardana, taurus and nexdatas"
-    docker exec  --user root ndts /bin/sh -c 'export DEBIAN_FRONTEND=noninteractive;  apt-get -qq update; apt-get -qq install -y  nxsconfigserver-db; sleep 10; apt-get -qq install -y python-nxsconfigserver python-nxswriter python-nxstools python-nxsrecselector  python-setuptools'
-    if [[ $1 == "debian10" ]]; then
-	docker exec  --user root ndts /bin/sh -c 'export DEBIAN_FRONTEND=noninteractive;  apt-get -qq update; apt-get -qq install -y python-taurus python-sardana'
+    docker exec  --user root ndts /bin/bash -c 'export DEBIAN_FRONTEND=noninteractive;  apt-get -qq update; apt-get -qq install -y  nxsconfigserver-db; sleep 10; apt-get -qq install -y python-nxsconfigserver python-nxswriter python-nxstools python-nxsrecselector  python-setuptools'
+    if [[ "$1" == "debian10" ]]; then
+	docker exec  --user root ndts /bin/bash -c 'export DEBIAN_FRONTEND=noninteractive;  apt-get -qq update; apt-get -qq install -y python-taurus python-sardana'
     else
-	if [[ $1 == "debian9" ]]; then
-	    docker exec  --user root ndts /bin/sh -c 'git clone https://github.com/hgrecco/pint pint-src'
-	    docker exec  --user root ndts /bin/sh -c 'cd pint-src; git checkout tags/0.9 -b b0.9; python setup.py install'
+	if [[ "$1" == "debian9" ]]; then
+	    docker exec  --user root ndts /bin/bash -c 'git clone https://github.com/hgrecco/pint pint-src'
+	    docker exec  --user root ndts /bin/bash -c 'cd pint-src; git checkout tags/0.9 -b b0.9; python setup.py install'
 	fi
-	docker exec  --user root ndts /bin/sh -c 'git clone https://gitlab.com/taurus-org/taurus taurus-src; cd taurus-src'
-	docker exec  --user root ndts /bin/sh -c 'cd taurus-src; git checkout tags/4.6.1 -b b4.6.1; python setup.py install'
-	docker exec  --user root ndts /bin/sh -c 'git clone https://github.com/sardana-org/sardana sardana-src; cd sardana-src'
-	docker exec  --user root ndts /bin/sh -c 'cd sardana-src; git checkout tags/2.8.4 -b b2.8.4; python setup.py install'
+	docker exec  --user root ndts /bin/bash -c 'git clone https://gitlab.com/taurus-org/taurus taurus-src; cd taurus-src'
+	docker exec  --user root ndts /bin/bash -c 'cd taurus-src; git checkout tags/4.6.1 -b b4.6.1; python setup.py install'
+	docker exec  --user root ndts /bin/bash -c 'git clone https://github.com/sardana-org/sardana sardana-src; cd sardana-src'
+	docker exec  --user root ndts /bin/bash -c 'cd sardana-src; git checkout tags/2.8.4 -b b2.8.4; python setup.py install'
     fi
 else
     echo "install sardana, taurus and nexdatas"
-    docker exec  --user root ndts /bin/sh -c 'export DEBIAN_FRONTEND=noninteractive; apt-get -qq update; apt-get install -y  nxsconfigserver-db; sleep 10; apt-get -qq install -y python3-nxsconfigserver python3-nxswriter python3-nxstools python3-nxsrecselector python3-setuptools nxsrecselector3 nxswriter3 nxsconfigserver3 nxstools3 python3-packaging'
-    if [[ $1 == "ubuntu20.04" ]]; then
-	docker exec  --user root ndts /bin/sh -c 'export DEBIAN_FRONTEND=noninteractive;  apt-get -qq update; apt-get -qq install -y python3-taurus python3-sardana'
+    docker exec  --user root ndts /bin/bash -c 'export DEBIAN_FRONTEND=noninteractive; apt-get -qq update; apt-get install -y  nxsconfigserver-db; sleep 10; apt-get -qq install -y python3-nxsconfigserver python3-nxswriter python3-nxstools python3-nxsrecselector python3-setuptools nxsrecselector3 nxswriter3 nxsconfigserver3 nxstools3 python3-packaging'
+    if  [ "$1" = "ubuntu20.04" ] || [ "$1" = "ubuntu20.10" ] || [ "$1" = "debian11" ] ; then
+	docker exec  --user root ndts /bin/bash -c 'export DEBIAN_FRONTEND=noninteractive;  apt-get -qq update; apt-get -qq install -y python3-taurus python3-sardana'
     else
-	docker exec  --user root ndts /bin/sh -c 'git clone https://gitlab.com/taurus-org/taurus taurus-src; cd taurus-src'
-	docker exec  --user root ndts /bin/sh -c 'cd taurus-src; git checkout tags/4.7.0 -b b4.7.0; python3 setup.py install'
-	docker exec  --user root ndts /bin/sh -c 'git clone https://github.com/sardana-org/sardana sardana-src; cd sardana-src'
-	docker exec  --user root ndts /bin/sh -c 'cd sardana-src; git checkout tags/3.1.0 -b b3.1.0; python3 setup.py install'
+	docker exec  --user root ndts /bin/bash -c 'git clone https://gitlab.com/taurus-org/taurus taurus-src; cd taurus-src'
+	docker exec  --user root ndts /bin/bash -c 'cd taurus-src; git checkout tags/4.7.0 -b b4.7.0; python3 setup.py install'
+	docker exec  --user root ndts /bin/bash -c 'git clone https://github.com/sardana-org/sardana sardana-src; cd sardana-src'
+	docker exec  --user root ndts /bin/bash -c 'cd sardana-src; git checkout tags/3.1.0 -b b3.1.0; python3 setup.py install'
     fi
 fi
-if [ "$?" -ne "0" ]
-then
-    exit -1
-fi
+if [ "$?" -ne "0" ]; then exit 255; fi
 
-if [[ $2 == "2" ]]; then
+if [[ "$2" == "2" ]]; then
     echo "install nxselector"
     docker exec  --user root ndts python setup.py -q install
 else
     echo "install nxselector3"
     docker exec  --user root ndts python3 setup.py -q install
 fi
-if [ "$?" -ne "0" ]
-then
-    exit -1
-fi
+if [ "$?" -ne "0" ]; then exit 255; fi
 
 docker exec  --user root ndts chown -R tango:tango .
diff --git a/.ci/run.sh b/.ci/run.sh
index 06d58e1..c34e714 100644
--- a/.ci/run.sh
+++ b/.ci/run.sh
@@ -1,13 +1,10 @@
 #!/usr/bin/env bash
 
-if [[ $1 == "2" ]]; then
+if [[ "$1" == "2" ]]; then
     echo "run python-sardana-nxsrecorder"
     docker exec  ndts python test
 else
     echo "run python3-sardana-nxsrecorder"
     docker exec  ndts python3 test
 fi
-if [ "$?" -ne "0" ]
-then
-    exit -1
-fi
+if [ "$?" -ne "0" ]; then exit 255; fi


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 732d4be..8a377fd 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -1,6 +1,10 @@
 name: Test Package
 
-on: [push, pull_request]
+on:
+  push:
+  pull_request:
+  schedule:
+    - cron: '30 1 26 * *'
 
 jobs:
 
@@ -20,7 +24,7 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        os: [debian10, debian9, ubuntu20.04, ubuntu18.04]
+        os: [debian11, debian10, ubuntu20.04]
     steps:
       - uses: actions/checkout@v2
       - uses: actions/setup-python@v2