summaryrefslogtreecommitdiff
path: root/net-analyzer/arping
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-01-29 18:03:51 +0000
committerV3n3RiX <venerix@redcorelinux.org>2021-01-29 18:03:51 +0000
commitd7ed2b01311f15ba54fe8ea872aab7d59ab2b193 (patch)
tree1814dd2b5bbf2e7639fdafbeef48d228cfaf5e9b /net-analyzer/arping
parentabaa75b10f899ada8dd05b23cc03205064394bc6 (diff)
gentoo resync : 29.01.2021
Diffstat (limited to 'net-analyzer/arping')
-rw-r--r--net-analyzer/arping/Manifest3
-rw-r--r--net-analyzer/arping/arping-2.21.ebuild19
-rw-r--r--net-analyzer/arping/files/arping-tests.patch190
3 files changed, 204 insertions, 8 deletions
diff --git a/net-analyzer/arping/Manifest b/net-analyzer/arping/Manifest
index 8d235176a392..ae52429ee364 100644
--- a/net-analyzer/arping/Manifest
+++ b/net-analyzer/arping/Manifest
@@ -1,8 +1,9 @@
+AUX arping-tests.patch 5643 BLAKE2B 154071667f814ec720a6fce36612d251ab891eb3972bd62e13fbfa233b56cff604a19feb80decaf448c1cd7b73c3c830c2529111372cbb6a81503e1b3a282273 SHA512 9b863431db1ca61ad69827dcf9427ab51bc2072251e358cbc90577e55907dcdb913e8bdef640bf3d77f46e7d6d44c8f69d5eab68d3e8c07af8fbc67df8e15e09
DIST arping-2.17.tar.gz 174346 BLAKE2B b0a095ff4e39e8f08b25a10db828e4ab9f60299043fbefc353b9df14e5bae839a93be20724ab9758b5bfc830c211e5f9bdfd606e321db508dbce9886b5903b09 SHA512 062026f522ab3d3b96c05c97aa3133995bce808a25a470207359a1236886da0300368ddac7d76568201510c0bcc2ac4ef6b34b2284c8d367c1be41972f0ee1c2
DIST arping-2.20.tar.gz 48102 BLAKE2B ce08c68e5d76db89f4f9ecb31bcee3316064cfd8ffd9615964677db33f214b856300de0dd2619430ce934b19f260cd38c8fa892636787ae4de82022301274a06 SHA512 c5fac3b43a9be8c63ee7707a7df1cef2d75c6f7944cc6e580450a6558fb7e72b0d97d09b5c9b4a3aa86a59f49faba94b39bd634c93917c11ae20ac59e8635282
DIST arping-2.21.tar.gz 50067 BLAKE2B 67b76cc48e9717117dbf43702df7f422634ed40196ec44d273a773610618922ddf7de47ffdf32cb7296db1dbce0a696c57b7992e6ad11f6fddf52a16212154fc SHA512 e976ce1a3ec0e4f57bbded09c6a07934e21df66ce7931422c420f5335dafcd88968f03ba6987d192dcdf51cca89180c86337aff50806713c7b04cb13e3e83504
EBUILD arping-2.17.ebuild 708 BLAKE2B 3f42edd2ff6cbcba37db121428174f06a7a88c0d7217918509b962b2f5da6f9db020102989bbdd4fb28c9a5077dd77e58bc5d4995712b7c71d37add6064ef122 SHA512 dbc00430158b3633e3b35fd2d72e17f27a1ec42c8e306a8d40e149cca5b909db5792d3f21fad1b7463803c4831b405a27a871c6db45f4df76157ea5408d1bcc3
EBUILD arping-2.20.ebuild 796 BLAKE2B d4637d26d201b66e4dd1a2c60efb22e5b60f239d6c538df33959d04d9ef69b3b6bc3c877ea731bc92544485b99abab067e20504af60820256740c41f9a00ba64 SHA512 dcbc382a2b8e77aeea9e945b3d1f3ec31c19c6b045d1c537f2e725ab9a89bbf73d9fd1194aecefc354956cafbd852b37b27968a427b381af5680e22f3d29e967
-EBUILD arping-2.21.ebuild 796 BLAKE2B d4637d26d201b66e4dd1a2c60efb22e5b60f239d6c538df33959d04d9ef69b3b6bc3c877ea731bc92544485b99abab067e20504af60820256740c41f9a00ba64 SHA512 dcbc382a2b8e77aeea9e945b3d1f3ec31c19c6b045d1c537f2e725ab9a89bbf73d9fd1194aecefc354956cafbd852b37b27968a427b381af5680e22f3d29e967
+EBUILD arping-2.21.ebuild 879 BLAKE2B bbd60e6d5cc86b35d4de0a1d2ac1da918e165f6329acb2498b685c5ce1ceeda98e86cf2dac30c014d43f047413fe5aae346163242e14f2fedee0612f5b0d664c SHA512 4cd3206c2c485069e5598b5f17aa03d2f8840383f1e79e00777cd406bb1c39d9556388fc29857d1371b972b5c6b2296f521b1d698fcc278e4774e839ca7dba6e
EBUILD arping-9999.ebuild 628 BLAKE2B 90f247f73d143e302004ac102e67baacf27385e1943d2e0bda9667aa8511fc3c5839b55738c4cce91bd649eaa51ba04d7face31680e561effd9e16db38f86753 SHA512 51046ede312bd8de290bb6c96bdea0aa2c95b2b6975af2bffc5147e3d82766b0f1d7528dd22c97eb838aadfc48b672927cc1a5a638b010105824d109aca4b12b
MISC metadata.xml 276 BLAKE2B e21811549278e73aa9a14acfe242fd022106a39ac1300caa00615772d7f54d08a433052659a271f9ac0d453c7776fc2b9e8d86e6d3f637817c214174dde52cb2 SHA512 f0e6c6bc89659e01e157d9bf30d0a2f3fd2d71bc26c8d12489c4a44fc5237159946e25b46e7295ab4676aea63559194977a0b1e76aced31d81cf6387dd0f4250
diff --git a/net-analyzer/arping/arping-2.21.ebuild b/net-analyzer/arping/arping-2.21.ebuild
index 889b70b2de49..6daaf2358a7a 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 000000000000..fb8592df372f
--- /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: