Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

New Formula for netperf #18197

Closed
wants to merge 1 commit into from

4 participants

@tomburns

Created a new formula for netperf. Test avoids disrupting any existing netserver processes; will use existing one if available.

@tomburns tomburns New Formula for netperf
Created a new formula for netperf. Test avoids disrupting any existing netserver processes; will use existing one if available.
3e93a13
@jacknagel
Owner
$ brew test ./netperf.rb -v
Testing netperf
==> netperf
netperf
complete_addrinfo: could not resolve 'localhost' port '0' af 2
    getaddrinfo returned 8 nodename nor servname provided, or not known
Error: netperf: failed
@tomburns

Fantastic; passed on three machines I installed on. This is a fairly tricky package to test due to limited options that exit 0, and I couldn't find an appropriate example browsing the repo. What's the standard for testing things with both a server and client component without meddling with a potentially extant process?

@adamv
Owner

"omit the test", I suppose.

@mikemcquaid
Owner

Better to just run a command with --version than omitting it; at least that verifies it has linked.

@adamv adamv was assigned
@adamv adamv closed this pull request from a commit
@tomburns tomburns netperf 2.6.0
Closes #18197.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
40715e2
@adamv adamv closed this in 40715e2
@lovelace lovelace referenced this pull request from a commit
@tomburns tomburns netperf 2.6.0
Closes #18197.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
31a95da
@handyman5 handyman5 referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@draftycode draftycode referenced this pull request from a commit in draftycode/homebrew
@tomburns tomburns netperf 2.6.0
Closes #18197.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
3480ee0
@shelhamer shelhamer referenced this pull request from a commit
@tomburns tomburns netperf 2.6.0
Closes #18197.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
f40039c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 3, 2013
  1. @tomburns

    New Formula for netperf

    tomburns authored
    Created a new formula for netperf. Test avoids disrupting any existing netserver processes; will use existing one if available.
This page is out of date. Refresh to see the latest.
Showing with 27 additions and 0 deletions.
  1. +27 −0 Library/Formula/netperf.rb
View
27 Library/Formula/netperf.rb
@@ -0,0 +1,27 @@
+require 'formula'
+
+class Netperf < Formula
+ homepage 'http://netperf.org'
+ url 'ftp://ftp.netperf.org/netperf/netperf-2.6.0.tar.bz2'
+ sha1 '3e1be4e7c3f7a838c4d5c00c6d20a619b320bfef'
+
+ def install
+ system "./configure", "--disable-dependency-tracking",
+ "--prefix=#{prefix}"
+ system "make install"
+ end
+
+ test do
+ #avoid disrupting existing netserver processes during testing
+ netserver_running = `ps aux | grep netserve[r]` != ""
+
+ unless netserver_running
+ fork do
+ system "netserver"
+ end
+ end
+
+ system "netperf"
+ system "killall netserver" unless netserver_running
+ end
+end
Something went wrong with that request. Please try again.