Merge lp:~axwalk/juju-core/local-dpkquery-isolation into lp:~go-bot/juju-core/trunk
Proposed by
Andrew Wilkins
Status: | Merged |
---|---|
Approved by: | Ian Booth |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2375 |
Proposed branch: | lp:~axwalk/juju-core/local-dpkquery-isolation |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
54 lines (+11/-1) 2 files modified
provider/local/prereqs.go (+4/-1) provider/local/prereqs_test.go (+7/-0) |
To merge this branch: | bzr merge lp:~axwalk/juju-core/local-dpkquery-isolation |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ian Booth | Approve | ||
Review via email: mp+209169@code.launchpad.net |
Commit message
provider/local: isolate tests from dpkg-query
The local provider uses dpkg-query to ensure
rsyslog-gnutls is available. This change
isolates the tests from the real dpgk-query.
Description of the change
provider/local: isolate tests from dpkg-query
The local provider uses dpkg-query to ensure
rsyslog-gnutls is available. This change
isolates the tests from the real dpgk-query.
To post a comment you must log in.
Reviewers: mp+209169_ code.launchpad. net,
Message:
Please take a look.
Description:
provider/local: isolate tests from dpkg-query
The local provider uses dpkg-query to ensure
rsyslog-gnutls is available. This change
isolates the tests from the real dpgk-query.
https:/ /code.launchpad .net/~axwalk/ juju-core/ local-dpkquery- isolation/ +merge/ 209169
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/71050043/
Affected files (+13, -1 lines): local/prereqs. go local/prereqs_ test.go
A [revision details]
M provider/
M provider/
Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: <email address hidden>
+New revision: <email address hidden>
Index: provider/ local/prereqs. go local/prereqs. go' local/prereqs. go 2014-02-28 07:27:59 +0000 local/prereqs. go 2014-03-04 04:38:17 +0000
=== modified file 'provider/
--- provider/
+++ provider/
@@ -67,6 +67,9 @@
// unit testing.
var lxclsPath = "lxc-ls"
+// isPackageInstalled is a variable to support testing. Installed nutlsPath is the default path to the
+var isPackageInstalled = utils.IsPackage
+
// defaultRsyslogG
// rsyslog GnuTLS module. This is a variable only to
// support unit testing.
@@ -143,7 +146,7 @@
}
func verifyRsyslogGn utls() error { Installed( "rsyslog- gnutls" ) { led("rsyslog- gnutls" ) {
- if utils.IsPackage
+ if isPackageInstal
return nil
}
if utils.IsUbuntu() {
Index: provider/ local/prereqs_ test.go local/prereqs_ test.go' local/prereqs_ test.go 2014-02-27 08:44:14 +0000 local/prereqs_ test.go 2014-03-04 04:38:17 +0000 net/juju- core/instance" net/juju- core/testing/ testbase" net/juju- core/upstart" net/juju- core/utils" net/juju- core/version"
=== modified file 'provider/
--- provider/
+++ provider/
@@ -14,6 +14,7 @@
"launchpad.
"launchpad.
"launchpad.
+ "launchpad.
"launchpad.
)
@@ -36,6 +37,11 @@
// even when mongodb and lxc-ls can't be
// found.
lxclsPath = "/bin/true"
+
+ // Allow non-prereq tests to pass by default.
+ isPackageInstalled = func(packageName string) bool {
+ return true
+ }
}
func (s *prereqsSuite) SetUpTest(c *gc.C) { "/bin/true" , filepath. Join(s. tmpdir, "dpkg-query")) &isPackageInsta lled, utils.IsPackage Installed)
@@ -55,6 +61,7 @@
// simulate package installation query responses.
err = os.Symlink(
c.Assert(err, gc.IsNil)
+ s.PatchValue(
}
func (*prereqsSuite) TestSupportedOS(c *gc.C) {