-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request juju#17461 from jack-w-shaw/3.5-into-3.6
juju#17461 Forward merge: - juju#17348 - juju#17413 - juju#17423 - juju#17436 - juju#17422 - juju#17446 - juju#17448 - juju#17444 - juju#17453 - juju#17440 - juju#17458 Conflicts: - acceptancetests/jujupy/client.py - acceptancetests/jujupy/tests/test_status.py - acceptancetests/repository/trusty/haproxy/cm.py - acceptancetests/tests/test_jujucharm.py - cmd/juju/cloud/addcredential.go - core/base/base.go - environs/bootstrap/bootstrap.go - provider/azure/environ.go - provider/azure/internal/imageutils/images.go - scripts/win-installer/setup.iss - snap/snapcraft.yaml - version/version.go Conflicts mostly trivial `provider/azure/internal/imageutils/images.go` took a bit of thought. This conflict resulted from my PR juju#17440
- Loading branch information
Showing
28 changed files
with
324 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ import ( | |
"strings" | ||
|
||
"github.com/juju/charm/v12" | ||
"github.com/juju/cmd/v3" | ||
"github.com/juju/errors" | ||
jc "github.com/juju/testing/checkers" | ||
"go.uber.org/mock/gomock" | ||
|
@@ -213,8 +214,10 @@ func (s *composeAndVerifyRepSuite) TestComposeAndVerifyBundleEmpty(c *gc.C) { | |
defer s.setupMocks(c).Finish() | ||
s.expectEmptyParts() | ||
s.expectBasePath() | ||
ctx, err := cmd.DefaultContext() | ||
c.Assert(err, jc.ErrorIsNil) | ||
|
||
obtained, _, err := ComposeAndVerifyBundle(s.bundleDataSource, nil) | ||
obtained, _, err := ComposeAndVerifyBundle(ctx, s.bundleDataSource, nil) | ||
c.Assert(err, gc.ErrorMatches, ".*bundle is empty not valid") | ||
c.Assert(obtained, gc.IsNil) | ||
} | ||
|
@@ -225,8 +228,10 @@ func (s *composeAndVerifyRepSuite) TestComposeAndVerifyBundleUnsupportedConstrai | |
c.Assert(err, jc.ErrorIsNil) | ||
s.expectParts(&charm.BundleDataPart{Data: bundleData}) | ||
s.expectBasePath() | ||
ctx, err := cmd.DefaultContext() | ||
c.Assert(err, jc.ErrorIsNil) | ||
|
||
obtained, _, err := ComposeAndVerifyBundle(s.bundleDataSource, nil) | ||
obtained, _, err := ComposeAndVerifyBundle(ctx, s.bundleDataSource, nil) | ||
c.Assert(err, gc.ErrorMatches, "*'image-id' constraint in a base bundle not supported") | ||
c.Assert(obtained, gc.IsNil) | ||
} | ||
|
@@ -237,8 +242,10 @@ func (s *composeAndVerifyRepSuite) TestComposeAndVerifyBundleNoOverlay(c *gc.C) | |
c.Assert(err, jc.ErrorIsNil) | ||
s.expectParts(&charm.BundleDataPart{Data: bundleData}) | ||
s.expectBasePath() | ||
ctx, err := cmd.DefaultContext() | ||
c.Assert(err, jc.ErrorIsNil) | ||
|
||
obtained, _, err := ComposeAndVerifyBundle(s.bundleDataSource, nil) | ||
obtained, _, err := ComposeAndVerifyBundle(ctx, s.bundleDataSource, nil) | ||
c.Assert(err, jc.ErrorIsNil) | ||
c.Assert(obtained, gc.DeepEquals, bundleData) | ||
} | ||
|
@@ -250,13 +257,15 @@ func (s *composeAndVerifyRepSuite) TestComposeAndVerifyBundleOverlay(c *gc.C) { | |
s.expectParts(&charm.BundleDataPart{Data: bundleData}) | ||
s.expectBasePath() | ||
s.setupOverlayFile(c) | ||
ctx, err := cmd.DefaultContext() | ||
c.Assert(err, jc.ErrorIsNil) | ||
|
||
expected := *bundleData | ||
expected.Applications["wordpress"].Options = map[string]interface{}{ | ||
"blog-title": "magic bundle config", | ||
} | ||
|
||
obtained, _, err := ComposeAndVerifyBundle(s.bundleDataSource, []string{s.overlayFile}) | ||
obtained, _, err := ComposeAndVerifyBundle(ctx, s.bundleDataSource, []string{s.overlayFile}) | ||
c.Assert(err, jc.ErrorIsNil) | ||
c.Assert(obtained, gc.DeepEquals, &expected) | ||
} | ||
|
@@ -268,13 +277,15 @@ func (s *composeAndVerifyRepSuite) TestComposeAndVerifyBundleOverlayUnsupportedC | |
s.expectParts(&charm.BundleDataPart{Data: bundleData}) | ||
s.expectBasePath() | ||
s.setupOverlayFile(c) | ||
ctx, err := cmd.DefaultContext() | ||
c.Assert(err, jc.ErrorIsNil) | ||
|
||
expected := *bundleData | ||
expected.Applications["wordpress"].Options = map[string]interface{}{ | ||
"blog-title": "magic bundle config", | ||
} | ||
|
||
obtained, _, err := ComposeAndVerifyBundle(s.bundleDataSource, []string{s.overlayFile}) | ||
obtained, _, err := ComposeAndVerifyBundle(ctx, s.bundleDataSource, []string{s.overlayFile}) | ||
c.Assert(err, gc.ErrorMatches, "*'image-id' constraint in a base bundle not supported") | ||
c.Assert(obtained, gc.IsNil) | ||
} | ||
|
@@ -290,13 +301,15 @@ func (s *composeAndVerifyRepSuite) TestComposeAndVerifyBundleOverlayUnmarshallEr | |
}) | ||
s.expectBasePath() | ||
s.setupOverlayFile(c) | ||
ctx, err := cmd.DefaultContext() | ||
c.Assert(err, jc.ErrorIsNil) | ||
|
||
expected := *bundleData | ||
expected.Applications["wordpress"].Options = map[string]interface{}{ | ||
"blog-title": "magic bundle config", | ||
} | ||
|
||
obtained, unmarshallErrors, err := ComposeAndVerifyBundle(s.bundleDataSource, []string{s.overlayFile}) | ||
obtained, unmarshallErrors, err := ComposeAndVerifyBundle(ctx, s.bundleDataSource, []string{s.overlayFile}) | ||
c.Assert(err, jc.ErrorIsNil) | ||
c.Assert(obtained, gc.DeepEquals, &expected) | ||
c.Assert(unmarshallErrors, gc.HasLen, 1) | ||
|
@@ -309,8 +322,10 @@ func (s *composeAndVerifyRepSuite) TestComposeAndVerifyBundleMixingBaseAndSeries | |
c.Assert(err, jc.ErrorIsNil) | ||
s.expectParts(&charm.BundleDataPart{Data: bundleData}) | ||
s.expectBasePath() | ||
ctx, err := cmd.DefaultContext() | ||
c.Assert(err, jc.ErrorIsNil) | ||
|
||
obtained, _, err := ComposeAndVerifyBundle(s.bundleDataSource, nil) | ||
obtained, _, err := ComposeAndVerifyBundle(ctx, s.bundleDataSource, nil) | ||
c.Assert(err, jc.ErrorIsNil) | ||
c.Assert(obtained, gc.DeepEquals, bundleData) | ||
} | ||
|
@@ -321,8 +336,10 @@ func (s *composeAndVerifyRepSuite) TestComposeAndVerifyBundleMixingBaseAndSeries | |
c.Assert(err, jc.ErrorIsNil) | ||
s.expectParts(&charm.BundleDataPart{Data: bundleData}) | ||
s.expectBasePath() | ||
ctx, err := cmd.DefaultContext() | ||
c.Assert(err, jc.ErrorIsNil) | ||
|
||
obtained, _, err := ComposeAndVerifyBundle(s.bundleDataSource, []string{s.overlayFile}) | ||
obtained, _, err := ComposeAndVerifyBundle(ctx, s.bundleDataSource, []string{s.overlayFile}) | ||
c.Assert(err, gc.ErrorMatches, `(?s)the provided bundle has the following errors:.*application "wordpress" series "jammy" and base "[email protected]" must match if both supplied.*invalid constraints.*`) | ||
c.Assert(obtained, gc.IsNil) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,3 +100,41 @@ func (s *BaseSuite) TestParseManifestBases(c *gc.C) { | |
} | ||
c.Assert(obtained, jc.DeepEquals, expected) | ||
} | ||
|
||
var ubuntuLTS = []Base{ | ||
MustParseBaseFromString("[email protected]"), | ||
MustParseBaseFromString("[email protected]"), | ||
MustParseBaseFromString("[email protected]"), | ||
MustParseBaseFromString("[email protected]/stable"), | ||
MustParseBaseFromString("[email protected]/edge"), | ||
} | ||
|
||
func (s *BaseSuite) TestIsUbuntuLTSForLTSes(c *gc.C) { | ||
for i, lts := range ubuntuLTS { | ||
c.Logf("Checking index %d base %v", i, lts) | ||
c.Check(lts.IsUbuntuLTS(), jc.IsTrue) | ||
} | ||
} | ||
|
||
var nonUbuntuLTS = []Base{ | ||
MustParseBaseFromString("[email protected]"), | ||
MustParseBaseFromString("[email protected]"), | ||
MustParseBaseFromString("[email protected]"), | ||
|
||
MustParseBaseFromString("[email protected]"), | ||
MustParseBaseFromString("[email protected]"), | ||
MustParseBaseFromString("[email protected]"), | ||
|
||
MustParseBaseFromString("[email protected]"), | ||
MustParseBaseFromString("[email protected]"), | ||
|
||
MustParseBaseFromString("centos@7"), | ||
MustParseBaseFromString("[email protected]"), | ||
} | ||
|
||
func (s *BaseSuite) TestIsUbuntuLTSForNonLTSes(c *gc.C) { | ||
for i, lts := range nonUbuntuLTS { | ||
c.Logf("Checking index %d base %v", i, lts) | ||
c.Check(lts.IsUbuntuLTS(), jc.IsFalse) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.