diff options
| author | Michael Vogt <mvo@ubuntu.com> | 2015-11-02 09:04:38 +0100 |
|---|---|---|
| committer | Michael Vogt <mvo@ubuntu.com> | 2015-11-02 09:04:38 +0100 |
| commit | f5d27b9fcd96b877ca234d36a66e014b4cf4d3d7 (patch) | |
| tree | 3c8cd1a513ad121d98a1af6477b3d1ae397ac832 | |
| parent | 7618113de9a75ee22a902d82d0dd36a7dc5f2ad5 (diff) | |
add test for getAppID()from-bzr/snappy-security-cleanupfeature/native-security-policygen
| -rw-r--r-- | snappy/security_test.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/snappy/security_test.go b/snappy/security_test.go index 74678109b7..182ce3e275 100644 --- a/snappy/security_test.go +++ b/snappy/security_test.go @@ -471,3 +471,19 @@ func (a *SecurityTestSuite) TestSecurityGetSeccompCustomPolicy(c *C) { c.Check(err, IsNil) c.Check(p, Equals, `canary`) } + +func (a *SecurityTestSuite) TestSecurityGetAppID(c *C) { + id, err := getAppID("pkg_app_1.0") + c.Assert(err, IsNil) + c.Assert(id, DeepEquals, &securityAppID{ + AppID: "pkg_app_1.0", + Pkgname: "pkg", + Appname: "app", + Version: "1.0", + }) +} + +func (a *SecurityTestSuite) TestSecurityGetAppIDInvalid(c *C) { + _, err := getAppID("invalid") + c.Assert(err, Equals, errInvalidAppID) +} |
