Skip to content

Commit e44c31c

Browse files
committed
BannedEapiCommand: add test for EAPI=9 banned commands
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
1 parent 46a37bb commit e44c31c

3 files changed

Lines changed: 31 additions & 0 deletions

File tree

testdata/data/repos/standalone/BadCommandsCheck/BannedEapiCommand/expected.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
{"__class__": "BannedEapiCommand", "category": "BadCommandsCheck", "package": "BannedEapiCommand", "version": "1", "line": "best_version --host-root stub/stub1:2", "lineno": 12, "command": "best_version --host-root", "eapi": "7"}
44
{"__class__": "BannedEapiCommand", "category": "BadCommandsCheck", "package": "BannedEapiCommand", "version": "2", "line": "usermod -s /bin/bash uucp", "lineno": 9, "command": "usermod", "eapi": "6"}
55
{"__class__": "BannedEapiCommand", "category": "BadCommandsCheck", "package": "BannedEapiCommand", "version": "2", "line": "usermod -s /bin/false uucp", "lineno": 13, "command": "usermod", "eapi": "6"}
6+
{"__class__": "BannedEapiCommand", "category": "BadCommandsCheck", "package": "BannedEapiCommand", "version": "3", "line": "assert \"failed\"", "lineno": 10, "command": "assert", "eapi": "9"}
7+
{"__class__": "BannedEapiCommand", "category": "BadCommandsCheck", "package": "BannedEapiCommand", "version": "3", "line": "domo foo.po", "lineno": 14, "command": "domo", "eapi": "9"}

testdata/data/repos/standalone/BadCommandsCheck/BannedEapiCommand/fix.patch

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,17 @@ diff -Naur standalone/BadCommandsCheck/BannedEapiCommand/BannedEapiCommand-2.ebu
3939
-pkg_postrm() {
4040
- usermod -s /bin/false uucp || die
4141
-}
42+
diff -Naur standalone/BadCommandsCheck/BannedEapiCommand/BannedEapiCommand-3.ebuild fixed/BadCommandsCheck/BannedEapiCommand/BannedEapiCommand-3.ebuild
43+
--- standalone/BadCommandsCheck/BannedEapiCommand/BannedEapiCommand-3.ebuild
44+
+++ fixed/BadCommandsCheck/BannedEapiCommand/BannedEapiCommand-3.ebuild
45+
@@ -7,9 +7,5 @@ SLOT="0"
46+
47+
src_unpack() {
48+
tar -xzf foo.tar.gz 3 | hexdump -C
49+
- assert "failed"
50+
-}
51+
-
52+
-src_install() {
53+
- domo foo.po
54+
+ pipestatus || die "failed"
55+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
EAPI=9
2+
3+
DESCRIPTION="Ebuild using banned commands"
4+
HOMEPAGE="https://github.com/pkgcore/pkgcheck"
5+
LICENSE="BSD"
6+
SLOT="0"
7+
8+
src_unpack() {
9+
tar -xzf foo.tar.gz 3 | hexdump -C
10+
assert "failed"
11+
}
12+
13+
src_install() {
14+
domo foo.po
15+
}

0 commit comments

Comments
 (0)