fuel-client tests fail silently when curl is not installed.

Bug #1566250 reported by Carlos Novo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
High
Marcellin Fom Tchassem
8.0.x
Won't Fix
High
MOS Maintenance
Mitaka
Won't Fix
High
Marcellin Fom Tchassem

Bug Description

Detailed bug description:

On debian based distributions ( tested on Mint 17.2 and Ubuntu 14.04 ), where "curl" program is not installed, the script prepare_nailgun.sh fails silently and the user does not know what was wrong:

/tmp/fuel_web/nailgun/.tox/venv/local/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.py:185: SAWarning: Unicode type received non-unicode bind param value 'Mitaka on Ubuntu+UCA 14.0...'. (this warning may be suppressed after 10 occurrences)
  (util.ellipses_string(value),))
ERROR: InvocationError: '/bin/bash /home/cnn/dev/openstack/fuel/python-fuelclient/tools/prepare_nailgun.sh'
cleanup develop-inst-nodeps: /home/cnn/dev/openstack/fuel/python-fuelclient

This issue is not happening in RH based distributions, and may be others, where "which" command prints a message in the case that the program is not present:

>> which curl
/usr/bin/which: no curl in (/home/cnn/Envs/fuel-web/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/cnn/bin:/home/cnn/bin)

Steps to reproduce:

- This issue is only present when the "which" command doesn't print any message when "curl" ( or any other ) is not present.
- Remove curl:
  apt-get remove curl
- Run python-fuelclient tests
 ./run_tests.sh

Expected results:

  There should be some information about "curl" is not present.

Actual result:

  The script fails silently and the user doesn't know why. The only message is:

  ERROR: InvocationError: '/bin/bash /home/cnn/dev/openstack/fuel/python-fuelclient/tools/prepare_nailgun.sh'

Reproducibility:

  Allways if "which" command is not printing a message when "curl" ( or any other ) is not present.

Workaround:

  No

Impact:

  The user doesn't know what was wrong.

Description of the environment:

  - Mint 17.2
  - Fuel 8.0.0

Aditional information:

The script prepare_nailgun.sh has -e flag in order to end on any error.
"which curl" fails in the case that curl is not present, and return code is 1, but it doesn't print any information.

Proposed fix:

Disable temporally the -e flag and print a proper message. Something like:

# Wait for server's availability
set +e
which curl > /dev/null
err=$?
if [[ $err != 0 ]]; then
  echo "ERROR: curl command does not exist"
  exit $err
fi
set -e

Ideally, that error should be printed only when the "which" version used is not doing it already.

Changed in fuel:
assignee: nobody → Marcellin Fom Tchassem (mf6510)
Changed in fuel:
importance: Undecided → High
milestone: none → 9.0
status: New → Confirmed
Carlos Novo (cnovo-k)
description: updated
Carlos Novo (cnovo-k)
tags: added: low-hanging-fruit
Changed in fuel:
milestone: 9.0 → 10.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-fuelclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/308538

Changed in fuel:
status: Confirmed → In Progress
Dmitry Pyzhov (dpyzhov)
tags: added: tech-debt
Revision history for this message
Dmitry Pyzhov (dpyzhov) wrote :

This is an issue with development environment. No real necessity to backport it.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-fuelclient (master)

Reviewed: https://review.openstack.org/308538
Committed: https://git.openstack.org/cgit/openstack/python-fuelclient/commit/?id=8f9bbb83f78b8c0d2726a1111bba6fbd40bffd27
Submitter: Jenkins
Branch: master

commit 8f9bbb83f78b8c0d2726a1111bba6fbd40bffd27
Author: Marcellin Fom Tchassem <email address hidden>
Date: Sat Apr 16 22:42:39 2016 -0500

    Tests fail silently when curl is not installed

    If curl program is not installed, the script prepare_nailgun.sh
    will fail in the fuel-client tests without giving any message.
    This commit will add the reason why the test failed.

    Change-Id: I747beefc2747e0fc8e5e4c87cf9561796585de96
    Closes-Bug: #1566250

Changed in fuel:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.