summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Hartmann <sultan@gentoo.org>2020-10-14 14:20:37 +0200
committerStephan Hartmann <sultan@gentoo.org>2020-10-14 14:20:54 +0200
commit654c5c0269f69aff96d96874a7acc939b7beda1b (patch)
tree49a9408282b06e9ffee3b62399c236c23e6eb60a /net-misc/croc
parentmedia-video/mediainfo: bump to 20.09 (diff)
downloadgentoo-654c5c0269f69aff96d96874a7acc939b7beda1b.tar.gz
gentoo-654c5c0269f69aff96d96874a7acc939b7beda1b.tar.bz2
gentoo-654c5c0269f69aff96d96874a7acc939b7beda1b.zip
net-misc/croc: enable tests
Package-Manager: Portage-3.0.8, Repoman-3.0.1 Signed-off-by: Stephan Hartmann <sultan@gentoo.org>
Diffstat (limited to 'net-misc/croc')
-rw-r--r--net-misc/croc/croc-8.5.1.ebuild8
-rw-r--r--net-misc/croc/files/croc-disable-network-tests.patch33
2 files changed, 41 insertions, 0 deletions
diff --git a/net-misc/croc/croc-8.5.1.ebuild b/net-misc/croc/croc-8.5.1.ebuild
index b6bbc70e7c63..2562bcb63af3 100644
--- a/net-misc/croc/croc-8.5.1.ebuild
+++ b/net-misc/croc/croc-8.5.1.ebuild
@@ -129,6 +129,10 @@ RDEPEND="
acct-user/croc
"
+PATCHES=(
+ "${FILESDIR}/${PN}-disable-network-tests.patch"
+)
+
DOCS=( README.md )
src_prepare() {
@@ -153,3 +157,7 @@ src_install() {
newbashcomp src/install/bash_autocomplete croc
einstalldocs
}
+
+src_test() {
+ go test -work ./... || die
+}
diff --git a/net-misc/croc/files/croc-disable-network-tests.patch b/net-misc/croc/files/croc-disable-network-tests.patch
new file mode 100644
index 000000000000..92a3a620b96e
--- /dev/null
+++ b/net-misc/croc/files/croc-disable-network-tests.patch
@@ -0,0 +1,33 @@
+Disable tests that fail with network-sandbox
+
+index 101162e..5be096e 100644
+--- a/src/utils/utils_test.go
++++ b/src/utils/utils_test.go
+@@ -7,7 +7,6 @@ import (
+ "log"
+ "math/rand"
+ "os"
+- "strings"
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+@@ -169,19 +168,6 @@ func TestHashFile(t *testing.T) {
+ assert.Equal(t, "18c9673a4bb8325d323e7f24fda9ae1e", fmt.Sprintf("%x", hashed))
+ }
+
+-func TestPublicIP(t *testing.T) {
+- ip, err := PublicIP()
+- fmt.Println(ip)
+- assert.True(t, strings.Contains(ip, ".") || strings.Contains(ip, ":"))
+- assert.Nil(t, err)
+-}
+-
+-func TestLocalIP(t *testing.T) {
+- ip := LocalIP()
+- fmt.Println(ip)
+- assert.True(t, strings.Contains(ip, ".") || strings.Contains(ip, ":"))
+-}
+-
+ func TestGetRandomName(t *testing.T) {
+ name := GetRandomName()
+ assert.NotEmpty(t, name)