Test script for Horizon installation
authorMaksym Yatsenko <myatsenko@mirantis.com>
Tue, 16 Sep 2014 10:08:56 +0000 (13:08 +0300)
committeriberezovskiy <iberezovskiy@mirantis.com>
Thu, 25 Sep 2014 08:27:29 +0000 (12:27 +0400)
Change-Id: I17a3ca9ec46af05d5677de36cd83d9ae8a01f9a8

debian/changelog
debian/control
rpm/SOURCES/0012-mos-fix-compression-error.patch [new file with mode: 0644]
rpm/SPECS/python-django-horizon.spec
tests/runtests.sh [new file with mode: 0755]

index 8ff256cb43e7b3763ae01d7cea2d3ef176baa0d7..bca6266b6de02e0739474785bb5d60b2a15ca90d 100644 (file)
@@ -1,3 +1,9 @@
+horizon (1:2014.2~b3-0ubuntu1) utopic; urgency=medium
+
+  * Update requirements
+
+ -- Ivan Berezovskiy <iberezovskiy@mirantis.com> Tue, 23 Sep 2014 16:27:02 +0400
+
 horizon (1:2014.2~b2-0ubuntu1) utopic; urgency=medium
 
   * New upstream release.
index 7e3e6527265c24e41c1cc1c1f7831ed131701b28..a907f39c2bdf12cfe6054853f98a93eec9b96794 100644 (file)
@@ -26,18 +26,25 @@ Depends:
  python-cinderclient (>= 1.0.7),
  python-cloudfiles,
  python-compressor (>= 1.4),
- python-django (>= 1.4),
+ python-django (>= 1.4.2), python-django (<< 1.7),
  python-django-pyscss (>= 1.0.2),
- python-glanceclient (>= 0.13.1),
- python-heatclient (>= 0.2.9) ,
- python-keystoneclient (>= 0.10.0),
- python-lockfile,
+ python-eventlet (>= 0.15.1),
+ python-glanceclient (>= 0.14.0),
+ python-heatclient (>= 0.2.9),
+ python-httplib2 (>= 0.7.5),
+ python-iso8601 (>= 0.1.9),
+ python-keystoneclient (>= 1:0.10.0),
+ python-kombu (>= 2.4.8),
+ python-lockfile (>= 0.8),
  python-memcache,
- python-netaddr,
- python-neutronclient (>= 2.3.6),
- python-novaclient (>= 2.17.0),
+ python-netaddr (>= 0.7.12),
+ python-neutronclient (>= 1:2.3.6), python-neutronclient (<< 1:3.0),
+ python-novaclient (>= 2.18.0),
  python-openstack-auth (>= 1.1.6),
- python-saharaclient (>= 0.6.0),
+ python-oslo.serialization (>= 1.0.0),
+ python-pbr (>= 0.6), python-pbr (<< 0.7) | python-pbr (>> 0.7), python-pbr (<< 1.0),
+ python-saharaclient (>= 0.7.3),
+ python-six (>= 1.7.0),
  python-swiftclient (>= 2.2.0),
  python-troveclient (>= 1.0.4),
  python-tz,
diff --git a/rpm/SOURCES/0012-mos-fix-compression-error.patch b/rpm/SOURCES/0012-mos-fix-compression-error.patch
new file mode 100644 (file)
index 0000000..10ac169
--- /dev/null
@@ -0,0 +1,14 @@
+diff --git a/horizon/templates/horizon/_scripts.html b/horizon/templates/horizon/_scripts.html
+index 3e3ec4f..c122fe2 100644
+--- a/horizon/templates/horizon/_scripts.html
++++ b/horizon/templates/horizon/_scripts.html
+@@ -32,9 +32,6 @@
+ <script src="{{ STATIC_URL }}bootstrap/js/bootstrap.js" type="text/javascript" charset="utf-8"></script>
+ <script src='{{ STATIC_URL }}horizon/lib/bootstrap_datepicker/bootstrap-datepicker.js' type='text/javascript' charset='utf-8'></script>
+-{% ifnotequal DATEPICKER_LOCALE 'en' %}
+-<script src='{{ STATIC_URL }}horizon/lib/bootstrap_datepicker/locales/bootstrap-datepicker.{{ DATEPICKER_LOCALE }}.js' type='text/javascript' charset='utf-8'></script>
+-{% endifnotequal %}
+ <script src="{{ STATIC_URL }}horizon/lib/hogan.js" type="text/javascript" charset='utf-8'></script>
index a2436f1d0b0243ffc7075b0466e3c48610a817b2..c701c0e2ad7d3f2fe3d5eb4ba7cc59dbb1a650b7 100644 (file)
@@ -1,6 +1,6 @@
 %global with_compression 1
 Name:       python-django-horizon
-Version:    2014.2
+Version:    2014.2.b3
 Release:    1%{?dist}
 Summary:    Django application for talking to Openstack
 
@@ -29,6 +29,7 @@ Source4:    openstack-dashboard-httpd-logging.conf
 #Patch0009: 0009-remove-runtime-dep-to-python-pbr.patch
 #Patch0010: 0010-Add-Change-password-link-to-the-RCUE-theme.patch
 #Patch0011: 0011-.less-replaced-in-rcue.patch
+Patch0012: 0012-mos-fix-compression-error.patch
 
 
 
@@ -45,14 +46,14 @@ Requires:       python-django >= 1.5
 
 Requires:   python-dateutil
 Requires:   pytz
-Requires:   python-lockfile
-Requires:   python-six >= 1.5.2
+Requires:   python-lockfile >= 0.8
+Requires:   python-six >= 1.7.0
 
 BuildRequires: python2-devel
 BuildRequires: python-setuptools
 BuildRequires: python-d2to1
-BuildRequires: python-pbr >= 0.7.0
-BuildRequires: python-lockfile
+BuildRequires: python-pbr > 0.7.0
+BuildRequires: python-lockfile >= 0.8
 BuildRequires: python-eventlet
 BuildRequires: git
 BuildRequires: python-six >= 1.7.0
@@ -67,7 +68,7 @@ BuildRequires:   python-nose-exclude
 BuildRequires:   python-nose
 BuildRequires:   python-selenium
 %endif
-BuildRequires:   python-netaddr
+BuildRequires:   python-netaddr >= 0.7.12
 BuildRequires:   python-kombu
 BuildRequires:   python-anyjson
 BuildRequires:   python-iso8601
@@ -98,20 +99,25 @@ Requires:   python-django-appconf
 Requires:   python-lesscpy
 %endif
 
-Requires:   python-glanceclient >= 0.13.1
-Requires:   python-keystoneclient >= 0.7.0
-Requires:   python-novaclient >= 2.15.0
-Requires:   python-neutronclient >= 2.3.6
-Requires:   python-cinderclient >= 1.0.6
+Requires:   python-glanceclient >= 0.14.0
+Requires:   python-keystoneclient >= 1:0.10.0
+Requires:   python-novaclient >= 2.18.0
+Requires:   python-neutronclient >= 2.3.6, python-neutronclient < 3.0
+Requires:   python-cinderclient >= 1.0.7
 Requires:   python-swiftclient >= 2.2.0
 Requires:   python-heatclient >= 0.2.9
 Requires:   python-ceilometerclient >= 1.0.6
-Requires:   python-troveclient >= 1.0.0
-Requires:   python-saharaclient >= 0.6.0
+Requires:   python-troveclient >= 1.0.4
+Requires:   python-saharaclient >= 0.7.3
+Requires:   python-httplib2 >= 0.7.5
+Requires:   python-iso8601 >= 0.1.9
+Requires:   python-kombu >= 2.4.8
 Requires:   python-netaddr
 Requires:   python-oslo-config
-Requires:   python-eventlet
-Requires:   python-django-pyscss
+Requires:   python-pbr >= 0.6, python-pbr < 0.7, python-pbr > 0.7, python-pbr < 1.0
+Requires:   python-eventlet >= 0.15.1
+Requires:   python-django >= 1.4.2, python-django < 1.7
+Requires:   python-django-pyscss >= 1.0.2
 Requires:   python-XStatic >= 1.0.0
 Requires:   python-XStatic-Angular >= 1.2.1.1
 Requires:   python-XStatic-Angular-Cookies >= 1.2.1.1
@@ -129,6 +135,8 @@ Requires:   python-XStatic-QUnit >= 1.14.0.2
 Requires:   python-XStatic-Rickshaw >= 1.5.0
 Requires:   python-XStatic-Spin >= 1.2.5.2
 Requires:   python-XStatic-jQuery >= 1.7.2
+Requires:   python-XStatic-Bootstrap-Datepicker >= 1.3.1.0
+Requires:   python-oslo-serialization >= 1.0.0
 
 BuildRequires: python-django-openstack-auth >= 1.1.6
 BuildRequires: python-django-compressor >= 1.4
@@ -154,7 +162,7 @@ BuildRequires: python-XStatic-QUnit >= 1.14.0.2
 BuildRequires: python-XStatic-Rickshaw >= 1.5.0
 BuildRequires: python-XStatic-Spin >= 1.2.5.2
 BuildRequires: python-oslo-sphinx
-BuildRequires: python-sphinx
+BuildRequires: python-oslo-serialization >= 1.0.0
 
 BuildRequires: python-six >= 1.7.0
 
@@ -177,16 +185,16 @@ BuildRequires: python-sphinx >= 1.1.3
 
 # Doc building basically means we have to mirror Requires:
 BuildRequires: python-dateutil
-BuildRequires: python-glanceclient  >= 0.13.1
-BuildRequires: python-keystoneclient
-BuildRequires: python-novaclient >= 2.15.0
-BuildRequires: python-neutronclient >= 2.3.6
-BuildRequires: python-cinderclient  >= 1.0.6
+BuildRequires: python-glanceclient  >= 0.14.0
+BuildRequires: python-keystoneclient >= 1:0.10.0
+BuildRequires: python-novaclient >= 2.18.0
+BuildRequires: python-neutronclient >= 2.3.6, python-neutronclient < 3.0
+BuildRequires: python-cinderclient  >= 1.0.7
 BuildRequires: python-swiftclient  >= 2.2.0
 BuildRequires: python-heatclient  >= 0.2.9
 BuildRequires: python-ceilometerclient >= 1.0.6
-BuildRequires: python-troveclient >= 1.0.0
-BuildRequires: python-saharaclient >= 0.6.0
+BuildRequires: python-troveclient >= 1.0.4
+BuildRequires: python-saharaclient >= 0.7.3
 BuildRequires: python-oslo-sphinx
 
 %description doc
@@ -201,6 +209,8 @@ Customization module for OpenStack Dashboard to provide a branded logo.
 
 %prep
 %setup -q -n horizon-%{version}
+
+%patch0012 -p1
 # Use git to manage patches.
 # http://rwmj.wordpress.com/2011/08/09/nice-rpm-git-patch-management-trick/
 #git init
@@ -346,6 +356,7 @@ mkdir -p %{buildroot}%{_var}/log/horizon
 %dir %{python_sitelib}/horizon
 %{python_sitelib}/horizon/*.py*
 %{python_sitelib}/horizon/browsers
+%{python_sitelib}/horizon/contrib/*.py*
 %{python_sitelib}/horizon/conf
 %{python_sitelib}/horizon/forms
 %{python_sitelib}/horizon/management
@@ -422,6 +433,10 @@ mkdir -p %{buildroot}%{_var}/log/horizon
 #%{_datadir}/openstack-dashboard/openstack_dashboard/enabled/_99_customization.*
 
 %changelog
+* Tue Sep 23 2014 Ivan Berezovskiy <iberezovskiy@mirantis.com> 2014.2.b3
+- Update requirements
+- Add simple tests
+
 * Thu Jul 31 2014 Matthias Runge <mrunge@redhat.com> 2014.2-0.2
 - rebase to Juno-2
 
diff --git a/tests/runtests.sh b/tests/runtests.sh
new file mode 100755 (executable)
index 0000000..c0aa028
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/bash -x
+
+RES=0
+
+case $1 in
+   openstack-dashboard)
+      if [[ `cat /etc/*-release | head -n 1 | awk '{print $1}'` =~ Ubuntu ]]; then
+         apache="apache2"
+         page="horizon"
+         chown -R horizon:horizon /usr/share/openstack-dashboard
+         sed -i "s/\#ALLOWED_HOSTS = \[.*/ALLOWED_HOSTS = \['127.0.0.1', \]/g" /etc/openstack-dashboard/local_settings.py
+      else
+         apache="httpd"
+         page="dashboard"
+         chown -R apache:apache /usr/share/openstack-dashboard
+         sed -i "s/LOCAL_PATH = .*/LOCAL_PATH = '\/tmp'/g" /etc/openstack-dashboard/local_settings
+      fi
+      service $apache restart
+
+      wget http://127.0.0.1/$page -O - | grep '<title>Login - OpenStack Dashboard</title>'
+      RES=$?
+   ;;
+   python-django-horizon)
+      python -c "import horizon"
+      RES=$?
+   ;;
+   *)
+      echo "test not defined, skipping..."
+   ;;
+esac
+
+exit $RES