Commit 9051d886 authored by Philippe Gauron's avatar Philippe Gauron
Browse files

Merge branch 'verification-environnement' into 'master'

Verification environnement

See merge request CCThomX/installation!42
parents b0f5de6d 9d7ebc69
File mode changed from 100644 to 100755
......@@ -21,6 +21,5 @@ DELETE FROM property_device WHERE device = "archiving/hdb/hdbarchivingwatcher.01
DELETE FROM property_class WHERE class = "HdbArchiver";
DELETE FROM property_class WHERE class = "HdbExtractor";
-- COMMIT TRANSACTION;
COMMIT;
\ No newline at end of file
COMMIT;
......@@ -20,4 +20,4 @@ DELETE FROM property_class WHERE class = "TdbArchiver";
DELETE FROM property_class WHERE class = "TdbExtractor";
-- COMMIT TRANSACTION;
COMMIT;
\ No newline at end of file
COMMIT;
......@@ -26,36 +26,56 @@ E_INCORRECT_JDK=44
## Awaited results
CORRECT_OUTPUT_DATABASE="+--------------------------------+
| Tables_in_tango |
+--------------------------------+
| access_address |
| access_device |
| attribute_alias |
| attribute_class |
| class_attribute_history_id |
| class_history_id |
| class_pipe_history_id |
| device |
| device_attribute_history_id |
| device_history_id |
| device_pipe_history_id |
| event |
| object_history_id |
| property |
| property_attribute_class |
| property_attribute_class_hist |
| property_attribute_device |
| property_attribute_device_hist |
| property_class |
| property_class_hist |
| property_device |
| property_device_hist |
| property_hist |
| property_pipe_class |
| property_pipe_class_hist |
| property_pipe_device |
| property_pipe_device_hist |
| server |
+--------------------------------+
28 rows in set ([0-9]\.[0-9]{2} sec)"
CORRECT_OUTPUT_DATABASE="access_address
access_device
attribute_alias
attribute_class
class_attribute_history_id
class_history_id
class_pipe_history_id
device
device_attribute_history_id
device_history_id
device_pipe_history_id
event
object_history_id
property
property_attribute_class
property_attribute_class_hist
property_attribute_device
property_attribute_device_hist
property_class
property_class_hist
property_device
property_device_hist
property_hist
property_pipe_class
property_pipe_class_hist
property_pipe_device
property_pipe_device_hist
server"
CORRECT_OUTPUT_ARCHIVING_HDB_DATABASE="adt
amt
apt"
CORRECT_OUTPUT_ARCHIVING_TDB_DATABASE="adt
amt
apt"
CORRECT_OUTPUT_ARCHIVING_SNAP_DATABASE="ast
context
list
snapshot
t_im_1val
t_im_2val
t_sc_num_1val
t_sc_num_2val
t_sc_str_1val
t_sc_str_2val
t_sp_1val
t_sp_2val"
......@@ -11,19 +11,25 @@ set +e
## Set to 1 to print every message
DEBUG=1
cd $(dirname "$0")
cd "$(dirname "$0")" || { echo "failure: cd $(dirname "$0")" ; exit 0; }
REPO_DIR=$(pwd)/
## Getting printing functions
# shellcheck source=utils.sh
source "${REPO_DIR}/utils.sh"
## Getting global variables
# shellcheck source=globals.sh
source "${REPO_DIR}/globals.sh"
## Getting installation settings
# shellcheck source=installation_parameters.sh
source "${REPO_DIR}/installation_parameters.sh"
## Sourcing /etc/tangorc
source /etc/tangorc
if [[ "${DEBUG}" -eq 1 ]]
then
info "Installation settings"
......@@ -79,7 +85,7 @@ fi
## global variable definition
CORRECT_TANGO_HOST="srv-2.thomx.fr:20000"
ERROR=0
# shellcheck disable=SC2034 # indexed arrays
typeset -a PAQUETS_PIP PAQUETS_VERSION
## pip packages
PIP_PACKAGES_NUMBER=4
......@@ -164,8 +170,8 @@ fi
if [[ "${TANGO_DB}" -eq 1 ]]
then
echo "Following asked password is MariaDB password for tango database"
RESULT_DATABASE=$(mysql -h localhost -u tango tango -p -e "SHOW tables")
if [[ "${RESULT_DATABASE}" != "${CORRECT_OUTPUT_DATABASE}" ]]
RESULT_DATABASE=$(mysql -sN -h localhost -u tango tango -p -e "SHOW tables")
if [[ "${RESULT_DATABASE}" == "${CORRECT_OUTPUT_DATABASE}" ]]
then
if [[ "${DEBUG}" -eq 1 ]]
then
......@@ -239,7 +245,7 @@ then
if [[ "${TANGOTEST_DEVICE_UNREACHABLE}" -ne 0 ]]
then
## starts TangoTest device for instance test
/usr/lib/tango/TangoTest test & > /dev/null
{ /usr/lib/tango/TangoTest test &> /dev/null & }
sleep 1
TANGOTEST_DEVICE_UNREACHABLE2=1
/usr/lib/tango/tango_admin --ping-device sys/tg_test/1 && TANGOTEST_DEVICE_UNREACHABLE2=0
......@@ -296,8 +302,8 @@ then
for package in ${DEBIAN_PACKAGES_CLIENT}
do
DEBIAN_PACKAGE_NOT_INSTALLED=1
$(dpkg -l | grep ^ii | grep "${package} " > /dev/null) && DEBIAN_PACKAGE_NOT_INSTALLED=0
if [[ "$?" -ne 0 ]]
dpkg -l | grep ^ii | grep "${package} " > /dev/null && DEBIAN_PACKAGE_NOT_INSTALLED=0
if [[ "${DEBIAN_PACKAGE_NOT_INSTALLED}" -ne 0 ]]
then
warning "debian package ${package} is not installed"
else
......@@ -310,8 +316,274 @@ then
fi
### ARCHIVING
if [[ "${ARCHIVING}" -eq 1 ]]
then
## vérifier l'existence de /var/archivage/hdb et /var/archivage/tdb
if [[ -d /var/archivage/hdb ]] \
&& [[ -d /var/archivage/tdb ]]
then
if [[ "${DEBUG}" -eq 1 ]]
then
info "/var/archivage/hdb & /var/archivage/tdb directories exists"
fi
else
warning "/var/archivage/hdb & /var/archivage/tdb directories does not exist"
fi
## hdb table content
RESULT_DATABASE=$(mysql -sN -h localhost -u hdbbrowser hdb -phdbbrowser -e "SHOW tables")
if [[ "${RESULT_DATABASE}" == ${CORRECT_OUTPUT_ARCHIVING_HDB_DATABASE}* ]]
then
if [[ "${DEBUG}" -eq 1 ]]
then
info "HDB successfully installed"
fi
else
warning "HDB installation failed!"
fi
## tdb table content
RESULT_DATABASE=$(mysql -sN -h localhost -u tdbbrowser tdb -ptdbbrowser -e "SHOW tables")
if [[ "${RESULT_DATABASE}" == ${CORRECT_OUTPUT_ARCHIVING_TDB_DATABASE}* ]]
then
if [[ "${DEBUG}" -eq 1 ]]
then
info "TDB successfully installed"
fi
else
warning "TDB installation failed!"
fi
### HdbArchiver
#### if HdbArchiver/01 is not defined
HDBARCHIVER_DS_UNDEFINED=1
/usr/lib/tango/tango_admin --check-server HdbArchiver/01 && HDBARCHIVER_DS_UNDEFINED=0
if [[ ${HDBARCHIVER_DS_UNDEFINED} -ne 0 ]]
then
warning "HdbArchiver Device Server is not defined"
else
if [[ "${DEBUG}" -eq 1 ]]
then
info "HdbArchiver Device Server is defined"
fi
fi
#### if archiving/hdb/hdbarchiver.01 is not defined
HDBARCHIVER_DEVICE_UNDEFINED=1
/usr/lib/tango/tango_admin --check-device archiving/hdb/hdbarchiver.01 && HDBARCHIVER_DEVICE_UNDEFINED=0
if [[ "${HDBARCHIVER_DEVICE_UNDEFINED}" -ne 0 ]]
then
warning "archiving/hdb/hdbarchiver.01 device is not defined"
else
if [[ "${DEBUG}" -eq 1 ]]
then
info "archiving/hdb/hdbarchiver.01 device is defined"
fi
fi
#### if HdbArchiver/01 does not respond to ping
HDBARCHIVER_DEVICE_UNREACHABLE=1
/usr/lib/tango/tango_admin --ping-device archiving/hdb/hdbarchiver.01 && HDBARCHIVER_DEVICE_UNREACHABLE=0
if [[ "${HDBARCHIVER_DEVICE_UNREACHABLE}" -ne 0 ]]
then
## starts HdbArchiver device for instance 01
/opt/ArchivingRoot/device/linux/HdbArchiver 01 &> /dev/null &
sleep 3
HDBARCHIVER_DEVICE_UNREACHABLE=1
/usr/lib/tango/tango_admin --ping-device archiving/hdb/hdbarchiver.01 && HDBARCHIVER_DEVICE_UNREACHABLE=0
if [[ "${HDBARCHIVER_DEVICE_UNREACHABLE}" -ne 0 ]]
then
warning "HdbArchiver/01 does not respond to ping"
else
if [[ "${DEBUG}" -eq 1 ]]
then
info "HdbArchiver/01 has been started"
fi
fi
else
if [[ "${DEBUG}" -eq 1 ]]
then
info "HdbArchiver/01 started"
fi
fi
### HdbExtractor
#### if HdbExtractor/01 is not defined
HDBEXTRACTOR_DS_UNDEFINED=1
/usr/lib/tango/tango_admin --check-server HdbExtractor/01 && HDBEXTRACTOR_DS_UNDEFINED=0
if [[ ${HDBEXTRACTOR_DS_UNDEFINED} -ne 0 ]]
then
warning "HdbExtractor Device Server is not defined"
else
if [[ "${DEBUG}" -eq 1 ]]
then
info "HdbExtractor Device Server is defined"
fi
fi
#### if archiving/hdb/hdbextractor.01 is not defined
HDBEXTRACTOR_DEVICE_UNDEFINED=1
/usr/lib/tango/tango_admin --check-device archiving/hdb/hdbextractor.01 && HDBEXTRACTOR_DEVICE_UNDEFINED=0
if [[ "${HDBEXTRACTOR_DEVICE_UNDEFINED}" -ne 0 ]]
then
warning "archiving/hdb/hdbextractor.01 device is not defined"
else
if [[ "${DEBUG}" -eq 1 ]]
then
info "archiving/hdb/hdbextractor.01 device is defined"
fi
fi
#### if HdbExtractor/01 does not respond to ping
HDBEXTRACTOR_DEVICE_UNREACHABLE=1
/usr/lib/tango/tango_admin --ping-device archiving/hdb/hdbextractor.01 && HDBEXTRACTOR_DEVICE_UNREACHABLE=0
if [[ "${HDBEXTRACTOR_DEVICE_UNREACHABLE}" -ne 0 ]]
then
## starts HdbExtractor device for instance 01
/opt/ArchivingRoot/device/linux/HdbExtractor 01 &> /dev/null &
sleep 3
HDBEXTRACTOR_DEVICE_UNREACHABLE=1
/usr/lib/tango/tango_admin --ping-device archiving/hdb/hdbextractor.01 && HDBEXTRACTOR_DEVICE_UNREACHABLE=0
if [[ "${HDBEXTRACTOR_DEVICE_UNREACHABLE}" -ne 0 ]]
then
warning "HdbExtractor/01 does not respond to ping"
else
if [[ "${DEBUG}" -eq 1 ]]
then
info "HdbExtractor/01 has been started"
fi
fi
else
if [[ "${DEBUG}" -eq 1 ]]
then
info "HdbExtractor/01 started"
fi
fi
### TdbArchiver
#### if TdbArchiver/01 is not defined
TDBARCHIVER_DS_UNDEFINED=1
/usr/lib/tango/tango_admin --check-server TdbArchiver/01 && TDBARCHIVER_DS_UNDEFINED=0
if [[ ${TDBARCHIVER_DS_UNDEFINED} -ne 0 ]]
then
warning "TdbArchiver Device Server is not defined"
else
if [[ "${DEBUG}" -eq 1 ]]
then
info "TdbArchiver Device Server is defined"
fi
fi
#### if archiving/tdb/tdbarchiver.01 is not defined
TDBARCHIVER_DEVICE_UNDEFINED=1
/usr/lib/tango/tango_admin --check-device archiving/tdb/tdbarchiver.01 && TDBARCHIVER_DEVICE_UNDEFINED=0
if [[ "${TDBARCHIVER_DEVICE_UNDEFINED}" -ne 0 ]]
then
warning "archiving/tdb/tdbarchiver.01 device is not defined"
else
if [[ "${DEBUG}" -eq 1 ]]
then
info "archiving/tdb/tdbarchiver.01 device is defined"
fi
fi
#### if TdbArchiver/01 does not respond to ping
TDBARCHIVER_DEVICE_UNREACHABLE=1
/usr/lib/tango/tango_admin --ping-device archiving/tdb/tdbarchiver.01 && TDBARCHIVER_DEVICE_UNREACHABLE=0
if [[ "${TDBARCHIVER_DEVICE_UNREACHABLE}" -ne 0 ]]
then
## starts TdbArchiver device for instance 01
/opt/ArchivingRoot/device/linux/TdbArchiver 01 &> /dev/null &
sleep 3
TDBARCHIVER_DEVICE_UNREACHABLE=1
/usr/lib/tango/tango_admin --ping-device archiving/tdb/tdbarchiver.01 && TDBARCHIVER_DEVICE_UNREACHABLE=0
if [[ "${TDBARCHIVER_DEVICE_UNREACHABLE}" -ne 0 ]]
then
warning "TdbArchiver/01 does not respond to ping"
else
if [[ "${DEBUG}" -eq 1 ]]
then
info "TdbArchiver/01 has been started"
fi
fi
else
if [[ "${DEBUG}" -eq 1 ]]
then
info "TdbArchiver/01 started"
fi
fi
### TdbExtractor
#### if TdbExtractor/01 is not defined
TDBEXTRACTOR_DS_UNDEFINED=1
/usr/lib/tango/tango_admin --check-server TdbExtractor/01 && TDBEXTRACTOR_DS_UNDEFINED=0
if [[ ${TDBEXTRACTOR_DS_UNDEFINED} -ne 0 ]]
then
warning "TdbExtractor Device Server is not defined"
else
if [[ "${DEBUG}" -eq 1 ]]
then
info "TdbExtractor Device Server is defined"
fi
fi
#### if archiving/tdb/tdbextractor.01 is not defined
TDBEXTRACTOR_DEVICE_UNDEFINED=1
/usr/lib/tango/tango_admin --check-device archiving/tdb/tdbextractor.01 && TDBEXTRACTOR_DEVICE_UNDEFINED=0
if [[ "${TDBEXTRACTOR_DEVICE_UNDEFINED}" -ne 0 ]]
then
warning "archiving/tdb/tdbextractor.01 device is not defined"
else
if [[ "${DEBUG}" -eq 1 ]]
then
info "archiving/tdb/tdbextractor.01 device is defined"
fi
fi
#### if TdbExtractor/01 does not respond to ping
TDBEXTRACTOR_DEVICE_UNREACHABLE=1
/usr/lib/tango/tango_admin --ping-device archiving/tdb/tdbextractor.01 && TDBEXTRACTOR_DEVICE_UNREACHABLE=0
if [[ "${TDBEXTRACTOR_DEVICE_UNREACHABLE}" -ne 0 ]]
then
## starts TdbExtractor device for instance 01
/opt/ArchivingRoot/device/linux/TdbExtractor 01 &> /dev/null &
sleep 3
TDBEXTRACTOR_DEVICE_UNREACHABLE=1
/usr/lib/tango/tango_admin --ping-device archiving/tdb/tdbextractor.01 && TDBEXTRACTOR_DEVICE_UNREACHABLE=0
if [[ "${TDBEXTRACTOR_DEVICE_UNREACHABLE}" -ne 0 ]]
then
warning "TdbExtractor/01 does not respond to ping"
else
if [[ "${DEBUG}" -eq 1 ]]
then
info "TdbExtractor/01 has been started"
fi
fi
else
if [[ "${DEBUG}" -eq 1 ]]
then
info "TdbExtractor/01 started"
fi
fi
fi
### TANGO_HOST
source /etc/tangorc
if [[ "${TANGO_HOST}" == "${CORRECT_TANGO_HOST}" ]]
then
if [[ "${DEBUG}" -eq 1 ]]
......@@ -335,7 +607,6 @@ fi
if [[ ! $(python -V 2>&1) == "Python 2.7"* ]]
then
warning "Python is not installed in version 2.7"
ERREUR=2
else
if [[ "${DEBUG}" -eq 1 ]]
then
......@@ -346,7 +617,7 @@ fi
## Check package installation of packages needed for taurus
## fandango==13.9.0 taurus==4.4.0 PyYAML==3.13 QtPy==1.2.1 python-qt4 python-qwt5-qt4 python-qtpy qt4-designer pyqt4-dev-tools
for ((package=0;package<${PIP_PACKAGES_NUMBER}; package++))
for ((package=0; package<PIP_PACKAGES_NUMBER; package++))
do
PIP_PACKAGE_NOT_INSTALLED=1
PIP_COMMAND=$(pip show "${PIP_PACKAGES[$package]}") && PIP_PACKAGE_NOT_INSTALLED=0
......@@ -372,8 +643,8 @@ done
for package in ${DEBIAN_PACKAGES}
do
DEBIAN_PACKAGE_NOT_INSTALLED=1
$(dpkg -l | grep ^ii | grep "${package} " > /dev/null) && DEBIAN_PACKAGE_NOT_INSTALLED=0
if [[ "$?" -ne 0 ]]
dpkg -l | grep ^ii | grep "${package} " > /dev/null && DEBIAN_PACKAGE_NOT_INSTALLED=0
if [[ "${DEBIAN_PACKAGE_NOT_INSTALLED}" -ne 0 ]]
then
warning "debian package ${package} is not installed"
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment