-
Notifications
You must be signed in to change notification settings - Fork 56
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 #497 from citrus-it/pkg.fmri
Add synthetic pkg.fmri.name attribute to pkgmogrify
- Loading branch information
Showing
3 changed files
with
24 additions
and
6 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
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 |
---|---|---|
|
@@ -70,7 +70,7 @@ class TestPkgMogrify(pkg5unittest.CliTestCase): | |
""" | ||
|
||
pkgcontents2 = """\ | ||
set name=pkg.fmri value=wombat/[email protected],5.11-0.101 | ||
set name=pkg.fmri value=pkg://tp/wombat/[email protected],5.11-0.101 | ||
set name=bugs value=12345 value=54321 value=13524 | ||
set name=justonebug value=12345 | ||
file thisismyhashvalue path=usr/bin/foo mode=0777 owner=root group=bin | ||
|
@@ -111,6 +111,7 @@ class TestPkgMogrify(pkg5unittest.CliTestCase): | |
"exit7 on bobcat": "<transform file bobcat=1 -> exit 7>", | ||
"exit6 on bobcat": "<transform file bobcat=1 -> exit 6 found a bobcat>", | ||
"pkg.fmri": '<transform file path=usr/bin/foo -> print pkg attr "%{{pkg.fmri}}" and the rest>', | ||
"pkg.fmri.name": '<transform file path=usr/bin/foo -> print pkg attr "%{{pkg.fmri.name}}" and the rest>', | ||
"pkg.bugs": '<transform file path=usr/bin/foo -> print pkg attr "%{{bugs}}" and the rest>', | ||
"fmrival": '<transform set name=pkg.fmri -> print test of "%(value)" ... or is it?>', | ||
"fmrinoval": '<transform set name=pkg.fmri -> print test of "%(valuee)" ... or is it?>', | ||
|
@@ -527,7 +528,7 @@ def test_11(self): | |
# ... or an action ... | ||
self.pkgmogrify([self.transforms["emitaction"], source_file]) | ||
self.assertMatch( | ||
"^depend fmri=wombat/[email protected],5.11-0.101 type=incorporate" | ||
"^depend fmri=pkg://tp/wombat/[email protected],5.11-0.101 type=incorporate" | ||
) | ||
|
||
# Recursive transforms shouldn't blow up. | ||
|
@@ -550,7 +551,7 @@ def test_12(self): | |
source_file = os.path.join(self.test_root, "source_file2") | ||
|
||
expect = r'^test of "{0}" ... or is it\?$' | ||
fmri = "wombat/[email protected],5.11-0.101" | ||
fmri = "pkg://tp/wombat/[email protected],5.11-0.101" | ||
|
||
# Simple %() replacement | ||
self.pkgmogrify([self.transforms["fmrival"], source_file]) | ||
|
@@ -625,9 +626,12 @@ def test_13(self): | |
# Simple valued | ||
self.pkgmogrify([self.transforms["pkg.fmri"], source_file]) | ||
self.assertMatch( | ||
'^pkg attr "wombat/[email protected],5.11-0.101" and ' "the rest$" | ||
'^pkg attr "pkg://tp/wombat/[email protected],5.11-0.101" and ' "the rest$" | ||
) | ||
|
||
self.pkgmogrify([self.transforms["pkg.fmri.name"], source_file]) | ||
self.assertMatch('^pkg attr "wombat/heaven" and ' "the rest$") | ||
|
||
# List valued | ||
self.pkgmogrify([self.transforms["pkg.bugs"], source_file]) | ||
self.assertMatch('^pkg attr "12345 54321 13524" and the rest$') | ||
|