public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-analyzer/arping/, net-analyzer/arping/files/
@ 2016-07-04  7:44 Jeroen Roovers
  0 siblings, 0 replies; 2+ messages in thread
From: Jeroen Roovers @ 2016-07-04  7:44 UTC (permalink / raw
  To: gentoo-commits

commit:     3771aaa9c45e3ca184b0615659c17a28f4685df3
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Mon Jul  4 07:42:06 2016 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Mon Jul  4 07:42:06 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3771aaa9

net-analyzer/arping: Old.

Package-Manager: portage-2.3.0

 net-analyzer/arping/arping-2.15-r2.ebuild          | 27 -------------------
 net-analyzer/arping/arping-2.15-r3.ebuild          | 31 ----------------------
 .../arping/files/arping-2.15-setgroups.patch       | 23 ----------------
 3 files changed, 81 deletions(-)

diff --git a/net-analyzer/arping/arping-2.15-r2.ebuild b/net-analyzer/arping/arping-2.15-r2.ebuild
deleted file mode 100644
index 93b1d79..0000000
--- a/net-analyzer/arping/arping-2.15-r2.ebuild
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-inherit autotools eutils
-
-DESCRIPTION="A utility to see if a specific IP address is taken and what MAC address owns it"
-HOMEPAGE="http://www.habets.pp.se/synscan/programs.php?prog=arping"
-SRC_URI="http://www.habets.pp.se/synscan/files/${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="2"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos"
-
-DEPEND="
-	net-libs/libpcap
-	net-libs/libnet:1.1
-"
-RDEPEND="${DEPEND}
-	!net-misc/iputils[arping(+)]"
-
-src_prepare() {
-	epatch "${FILESDIR}"/${PN}-2.15-setgroups.patch
-
-	eautoreconf
-}

diff --git a/net-analyzer/arping/arping-2.15-r3.ebuild b/net-analyzer/arping/arping-2.15-r3.ebuild
deleted file mode 100644
index 8ede2e3..0000000
--- a/net-analyzer/arping/arping-2.15-r3.ebuild
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-inherit autotools eutils fcaps
-
-DESCRIPTION="A utility to see if a specific IP address is taken and what MAC address owns it"
-HOMEPAGE="http://www.habets.pp.se/synscan/programs.php?prog=arping"
-SRC_URI="http://www.habets.pp.se/synscan/files/${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="2"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos"
-
-DEPEND="
-	net-libs/libpcap
-	net-libs/libnet:1.1
-"
-RDEPEND="
-	${DEPEND}
-	!net-misc/iputils[arping(+)]
-"
-
-FILECAPS=( cap_net_raw /usr/sbin/arping )
-
-src_prepare() {
-	epatch "${FILESDIR}"/${PN}-2.15-setgroups.patch
-
-	eautoreconf
-}

diff --git a/net-analyzer/arping/files/arping-2.15-setgroups.patch b/net-analyzer/arping/files/arping-2.15-setgroups.patch
deleted file mode 100644
index 59b6758..0000000
--- a/net-analyzer/arping/files/arping-2.15-setgroups.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -35,6 +35,7 @@
- stdlib.h \
- sys/socket.h \
- time.h \
-+grp.h \
- sys/time.h \
- sys/types.h \
- sys/capability.h \
---- a/src/arping.c
-+++ b/src/arping.c
-@@ -98,6 +98,10 @@
- #endif
- #include <pcap.h>
- 
-+#if HAVE_GRP_H
-+#include <grp.h>
-+#endif
-+
- #include "arping.h"
- 
- #ifndef ETH_ALEN


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-analyzer/arping/, net-analyzer/arping/files/
@ 2021-01-25 19:46 Aaron Bauman
  0 siblings, 0 replies; 2+ messages in thread
From: Aaron Bauman @ 2021-01-25 19:46 UTC (permalink / raw
  To: gentoo-commits

commit:     1fc264333692e3e16eb2fb00aee0aa26cc695453
Author:     Aaron Bauman <bman <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 25 19:45:30 2021 +0000
Commit:     Aaron Bauman <bman <AT> gentoo <DOT> org>
CommitDate: Mon Jan 25 19:46:44 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1fc26433

net-analyzer/arping: fix tests

* add new dev-python/subunit dep for tests
* shorten pkg desc within char limit
* other formatting changes

Closes: https://bugs.gentoo.org/757090
Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>

 net-analyzer/arping/arping-2.21.ebuild       |  19 ++-
 net-analyzer/arping/files/arping-tests.patch | 190 +++++++++++++++++++++++++++
 2 files changed, 202 insertions(+), 7 deletions(-)

diff --git a/net-analyzer/arping/arping-2.21.ebuild b/net-analyzer/arping/arping-2.21.ebuild
index 889b70b2de4..6daaf2358a7 100644
--- a/net-analyzer/arping/arping-2.21.ebuild
+++ b/net-analyzer/arping/arping-2.21.ebuild
@@ -2,9 +2,10 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
+
 inherit autotools fcaps
 
-DESCRIPTION="A utility to see if a specific IP address is taken and what MAC address owns it"
+DESCRIPTION="A utility to see if a specific IP is taken and what MAC owns it"
 HOMEPAGE="http://www.habets.pp.se/synscan/programs.php?prog=arping"
 SRC_URI="https://github.com/ThomasHabets/${PN}/archive/${P}.tar.gz"
 
@@ -16,19 +17,23 @@ RESTRICT="!test? ( test )"
 
 CDEPEND="
 	net-libs/libpcap
-	net-libs/libnet:1.1
-"
+	net-libs/libnet:1.1"
 DEPEND="
 	${CDEPEND}
-	test? ( dev-libs/check )
-"
+	test? (
+		dev-libs/check
+		dev-python/subunit )"
 RDEPEND="
 	${CDEPEND}
-	!net-misc/iputils[arping(+)]
-"
+	!net-misc/iputils[arping(+)]"
+
 FILECAPS=( cap_net_raw /usr/sbin/arping )
+
 S=${WORKDIR}/${PN}-${P}
 
+# patch is in upstream master
+PATCHES=( "${FILESDIR}/arping-tests.patch" )
+
 src_prepare() {
 	default
 	eautoreconf

diff --git a/net-analyzer/arping/files/arping-tests.patch b/net-analyzer/arping/files/arping-tests.patch
new file mode 100644
index 00000000000..fb8592df372
--- /dev/null
+++ b/net-analyzer/arping/files/arping-tests.patch
@@ -0,0 +1,190 @@
+diff --git a/src/arping_test.c b/src/arping_test.c
+index 438670b..0133fe7 100644
+--- a/src/arping_test.c
++++ b/src/arping_test.c
+@@ -40,35 +40,10 @@ extern libnet_t* libnet;
+ extern int mock_libnet_lo_ok;
+ extern int mock_libnet_null_ok;
+
+-struct registered_test {
+-        void* fn;
+-        const char* name;
+-};
+-
+-static int numtests = 0;
+-static struct registered_test test_registry[1024];
+-
+-static int num_exit_tests = 0;
+-static struct registered_test test_exit_registry[1024];
+-
+ int get_mac_addr(const char *in, char *out);
+ void strip_newline(char* s);
+
+
+-#define MYTEST(a) static void a(int);__attribute__((constructor)) \
+-static void cons_##a() {                           \
+-                test_registry[numtests].fn = a;    \
+-                test_registry[numtests].name = #a; \
+-                numtests++;                        \
+-} START_TEST(a)
+-
+-#define MY_EXIT_TEST(a) static void a(int);__attribute__((constructor)) \
+-static void cons_##a() {                                      \
+-                test_exit_registry[num_exit_tests].fn = a;    \
+-                test_exit_registry[num_exit_tests].name = #a; \
+-                num_exit_tests++;                             \
+-} START_TEST(a)
+-
+ /**
+  *
+  */
+@@ -236,7 +211,7 @@ dump_packet(uint8_t* packet, int len)
+         fprintf(stderr, "\n");
+ }
+
+-MYTEST(test_mkpacket)
++START_TEST(test_mkpacket)
+ {
+         uint8_t correct_packet[] = {
+                 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa,
+@@ -261,7 +236,7 @@ MYTEST(test_mkpacket)
+
+
+ // Received uninteresting packet, should not record anything.
+-MYTEST(pingip_uninteresting_packet)
++START_TEST(pingip_uninteresting_packet)
+ {
+         struct pcap_pkthdr pkthdr;
+         uint8_t* packet;
+@@ -389,7 +364,7 @@ MYTEST(pingip_uninteresting_packet)
+ } END_TEST
+
+ // Received reply that actually matches. Things should happen.
+-MYTEST(pingip_interesting_packet)
++START_TEST(pingip_interesting_packet)
+ {
+         struct pcap_pkthdr pkthdr;
+         extern uint8_t srcmac[ETH_ALEN];
+@@ -449,7 +424,7 @@ MYTEST(pingip_interesting_packet)
+                     "numrecvd not incremented second time");
+ } END_TEST
+
+-MYTEST(strip_newline_test)
++START_TEST(strip_newline_test)
+ {
+         const char *tests[][2] = {
+                 {"", ""},
+@@ -469,7 +444,7 @@ MYTEST(strip_newline_test)
+         }
+ } END_TEST
+
+-MYTEST(get_mac_addr_success)
++START_TEST(get_mac_addr_success)
+ {
+         const char *tests[][2] = {
+                 // Null.
+@@ -501,7 +476,7 @@ MYTEST(get_mac_addr_success)
+         }
+ } END_TEST
+
+-MYTEST(get_mac_addr_fail)
++START_TEST(get_mac_addr_fail)
+ {
+         const char *tests[] = {
+                 "",
+@@ -517,7 +492,7 @@ MYTEST(get_mac_addr_fail)
+         }
+ } END_TEST
+
+-MY_EXIT_TEST(libnet_init_bad_nolo)
++START_TEST(libnet_init_bad_nolo)
+ {
+         // It'll only try lo if named interface fails.
+         // So by accepting lo, we make sure it doesn't try lo.
+@@ -525,27 +500,28 @@ MY_EXIT_TEST(libnet_init_bad_nolo)
+         do_libnet_init("bad", 0);
+ } END_TEST
+
+-MY_EXIT_TEST(libnet_init_null_nolo_nonull)
++START_TEST(libnet_init_null_nolo_nonull)
+ {
+         mock_libnet_lo_ok = 0;
+         mock_libnet_null_ok = 0;
+         do_libnet_init(NULL, 0);
+ } END_TEST
+
+-MYTEST(libnet_init_good)
++START_TEST(libnet_init_good)
+ {
+         mock_libnet_lo_ok = 0; // Don't even try falling back to lo.
+         do_libnet_init("good", 0);
+         fail_if(libnet == NULL);
+ } END_TEST
+
+-MYTEST(libnet_init_null_nolo)
++START_TEST(libnet_init_null_nolo)
+ {
+         mock_libnet_lo_ok = 0;
+         mock_libnet_null_ok = 1;
+         do_libnet_init(NULL, 0);
+         fail_if(libnet == NULL);
+-} END_TEST
++}
++END_TEST
+
+ static Suite*
+ arping_suite(void)
+@@ -553,17 +529,34 @@ arping_suite(void)
+         int c;
+         Suite* s = suite_create("Arping");
+
+-        //tcase_add_checked_fixture (tc_core, setup, teardown);
+-        for (c = 0; c < numtests; c++) {
+-                TCase *tc_core = tcase_create(test_registry[c].name);
+-                tcase_add_test(tc_core, test_registry[c].fn);
+-                suite_add_tcase(s, tc_core);
+-        }
+-        for (c = 0; c < num_exit_tests; c++) {
+-                TCase *tc_core = tcase_create(test_exit_registry[c].name);
+-                tcase_add_exit_test(tc_core, test_exit_registry[c].fn, 1);
+-                suite_add_tcase(s, tc_core);
+-        }
++
++        TCase *tc_core;
++
++        // libcheck broke test registries, so have to resort to code duplication. :-(
++        // https://github.com/libcheck/check/pull/158/files
++#define SIGH_LIBCHECK(tn) \
++        tc_core = tcase_create(#tn);   \
++        tcase_add_test(tc_core, tn); \
++        suite_add_tcase(s, tc_core);
++
++        SIGH_LIBCHECK(libnet_init_null_nolo);
++        SIGH_LIBCHECK(test_mkpacket);
++        SIGH_LIBCHECK(pingip_uninteresting_packet);
++        SIGH_LIBCHECK(pingip_interesting_packet);
++        SIGH_LIBCHECK(strip_newline_test);
++        SIGH_LIBCHECK(get_mac_addr_success);
++        SIGH_LIBCHECK(get_mac_addr_fail);
++        SIGH_LIBCHECK(libnet_init_good);
++
++
++#define SIGH_LIBCHECK_EXIT(tn)          \
++        tc_core = tcase_create(#tn);   \
++        tcase_add_exit_test(tc_core, tn, 1);      \
++        suite_add_tcase(s, tc_core);
++
++        SIGH_LIBCHECK_EXIT(libnet_init_bad_nolo);
++        SIGH_LIBCHECK_EXIT(libnet_init_null_nolo_nonull);
++
+         return s;
+ }
+
+@@ -577,6 +570,7 @@ main()
+         number_failed = srunner_ntests_failed (sr);
+         srunner_free (sr);
+         return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
++        return 0;
+ }
+ /* ---- Emacs Variables ----
+  * Local Variables:


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-25 19:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-04  7:44 [gentoo-commits] repo/gentoo:master commit in: net-analyzer/arping/, net-analyzer/arping/files/ Jeroen Roovers
  -- strict thread matches above, loose matches on Subject: below --
2021-01-25 19:46 Aaron Bauman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox