~ubuntu-branches/ubuntu/raring/nova/raring-proposed

« back to all changes in this revision

Viewing changes to nova/tests/test_versions.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Chuck Short, Adam Gandelman, Yolanda Robla, James Page
  • Date: 2013-01-11 13:06:56 UTC
  • mfrom: (1.1.67)
  • Revision ID: package-import@ubuntu.com-20130111130656-7n7fkevy03stm3mv
Tags: 2013.1~g2-0ubuntu1
[ Chuck Short ]
* New upstream release.
* debian/patches/ubuntu-show-tests.patch: Dropped no longer needed.
* debian/nova-xcp-plugins.install: Fix xcp-plugins empty packages
* debian/control: Drop python-nose in favor or testrepository
* debian/control: Add python-coverage as a build dep.
* debian/rules, debian/control: Run pep8 tests.
* debian/*.init: Remove they are not needed and take up space
* debian/control, debian/nova-cells.{install, logrotate, upstart}: Add
  cells support.
* debian/patches/fix-ubuntu-tests.patch: temporarily disable failing tests.
* debian/control, debian/nova-baremetal.{install, logrotate, upstart}: Add
  nova baremetal support.
* debian/control: Remove python-support.

[ Adam Gandelman ]
* debian/*.manpages: Install Sphinx-generated manpages instead of
  our own.
* debian/nova-compute-*.conf: Specify the newly required compute_driver
  flag in addition to libvirt_type.
* debian/control:  Specify required python-webob and python-stevedore
  versions.

[ Yolanda Robla ]
* debian/*.upstart: Use start-stop-daemon instead of su for chuid
  (LP: #1086833).
* debian/rules: Remove override of dh_installinit for discriminating
  between Debian and Ubuntu.
* debian/nova-common.docs: Installing changelogs from rules
* debian/rules: Replacing perms in /etc/nova/logging.conf for 0644
* debian/control: adduser dependency on nova-compute.
* debian/control: added section oldlibs and priority extra on
  nova-ajax-console-proxy.
* debian/nova-xvpvncproxy.postrm: removing because of duplicates.

[ James Page ]
* d/control: Add ~ to python-sqlalchemy-ext versioned dependencies to
  make backporting easier.
* d/control: Updated nova-volume description and depdendencies to
  mark it as a transitional package, moved to oldlibs/extra.
* d/p/fix-libvirt-tests.patch: Dropped; accepted upstream.
* d/control: Added python-stevedore to BD's.
* d/*.postrm: Dropped postrm's that just run update-rc.d; this is not
  required when deploying upstart configurations only.
* d/nova-scheduler.manpages: Add man page for nova-rpc-zmq-receiver.
* d/rules: Install upstream changelog with a policy compliant name.
* d/control: Mark nova-compute-xcp as virtual package.
* d/control: nova-api-os-volume; Depend on cinder-api and mark as
  transitional package.
* d/nova-api-os-volume.lintian-overrides: Dropped - no longer required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
#    License for the specific language governing permissions and limitations
15
15
#    under the License.
16
16
 
 
17
import __builtin__
 
18
import StringIO
17
19
 
 
20
from nova.openstack.common import cfg
18
21
from nova import test
19
22
from nova import version
20
23
 
31
34
        self.version.version_info = {'branch_nick': u'LOCALBRANCH',
32
35
                                    'revision_id': 'LOCALREVISION',
33
36
                                    'revno': 0}
 
37
        self.version.NOVA_PACKAGE = "g9ec3421"
34
38
 
35
39
    def test_version_string_is_good(self):
36
40
        """Ensure version string works"""
48
52
        self.assertEqual(self.version.canonical_version_string(),
49
53
                        self.version.version_string())
50
54
 
51
 
    def test_vcs_version_string_is_good(self):
52
 
        """Ensure uninstalled code generates local """
53
 
        self.assertEqual("LOCALBRANCH:LOCALREVISION",
54
 
                        self.version.vcs_version_string())
55
 
 
56
 
    def test_version_string_with_vcs_is_good(self):
 
55
    def test_version_string_with_package_is_good(self):
57
56
        """Ensure uninstalled code get version string"""
58
 
        self.assertEqual("2012.10-LOCALBRANCH:LOCALREVISION",
59
 
                        self.version.version_string_with_vcs())
 
57
        self.assertEqual("2012.10-g9ec3421",
 
58
                        self.version.version_string_with_package())
 
59
 
 
60
    def test_release_file(self):
 
61
        version.loaded = False
 
62
        real_open = __builtin__.open
 
63
        real_find_file = cfg.CONF.find_file
 
64
 
 
65
        def fake_find_file(self, name):
 
66
            if name == "release":
 
67
                return "/etc/nova/release"
 
68
            return real_find_file(self, name)
 
69
 
 
70
        def fake_open(path, *args, **kwargs):
 
71
            if path == "/etc/nova/release":
 
72
                data = """[Nova]
 
73
vendor = ACME Corporation
 
74
product = ACME Nova
 
75
package = 1337"""
 
76
                return StringIO.StringIO(data)
 
77
 
 
78
            return real_open(path, *args, **kwargs)
 
79
 
 
80
        self.stubs.Set(__builtin__, 'open', fake_open)
 
81
        self.stubs.Set(cfg.ConfigOpts, 'find_file', fake_find_file)
 
82
 
 
83
        self.assertEqual(version.vendor_string(), "ACME Corporation")
 
84
        self.assertEqual(version.product_string(), "ACME Nova")
 
85
        self.assertEqual(version.package_string(), "1337")