-
Notifications
You must be signed in to change notification settings - Fork 440
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
meta: add
base
as a type and top level property (#1419)
- Loading branch information
1 parent
e68d25a
commit 024b920
Showing
8 changed files
with
105 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: base-example-consumer | ||
version: 1.0 | ||
summary: Example snap that consumes a different base snap | ||
description: | ||
This example snap uses the base-example base snap instead of | ||
the regular "core" snap. | ||
confinement: strict | ||
base: base-example | ||
|
||
apps: | ||
hello: | ||
command: usr/bin/hello | ||
|
||
parts: | ||
libc: | ||
plugin: dump | ||
source: . | ||
stage-packages: [hello] |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: base-example | ||
version: 1.0 | ||
summary: Example base snap | ||
description: | ||
A base snap is a special kind of snap that can be used by | ||
other snaps as an alternative base. This base will then | ||
be used as the root filesystem instead of the traditional | ||
core snap. | ||
|
||
This example base snap only contains a basic libc6. | ||
type: base | ||
|
||
parts: | ||
libc: | ||
plugin: dump | ||
source: . | ||
stage-packages: [libc6] |
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 |
---|---|---|
|
@@ -53,6 +53,7 @@ | |
_OPTIONAL_PACKAGE_KEYS = [ | ||
'architectures', | ||
'assumes', | ||
'base', | ||
'environment', | ||
'type', | ||
'plugs', | ||
|
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- | ||
# | ||
# Copyright (C) 2017 Canonical Ltd | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License version 3 as | ||
# published by the Free Software Foundation. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
import snaps_tests | ||
|
||
|
||
class BaseExampleTestCase(snaps_tests.SnapsTestCase): | ||
|
||
snap_content_dir = 'base-example' | ||
|
||
def test_base_example(self): | ||
# Build snap will raise an exception in case of error. | ||
snap_path = self.build_snap(self.snap_content_dir) | ||
# Install snap will raise an exception in case of error. | ||
self.install_snap(snap_path, 'base-example', '1.0') | ||
# more testing is done in test_base-consumer |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- | ||
# | ||
# Copyright (C) 2017 Canonical Ltd | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License version 3 as | ||
# published by the Free Software Foundation. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
import snaps_tests | ||
|
||
|
||
class BaseExampleConsumerTestCase(snaps_tests.SnapsTestCase): | ||
|
||
base_content_dir = 'base-example' | ||
base_consumer_content_dir = 'base-example-consumer' | ||
|
||
def test_base_example(self): | ||
# build/install the alternative base | ||
snap_path = self.build_snap(self.base_content_dir) | ||
self.install_snap(snap_path, 'base-example', '1.0') | ||
# build the consumer | ||
snap_path = self.build_snap(self.base_consumer_content_dir) | ||
self.install_snap(snap_path, 'base-example-consumer', '1.0') | ||
# FIXME: once snapd supports bases fully run hello against | ||
# the alternative base |