Skip to content

Commit

Permalink
Switched output folder to temp folder location
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-odintsov committed Jun 19, 2022
1 parent ec1a853 commit 43ae1c9
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/packaging/homebrew/fastnetmon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ def install
test do
cp etc/"fastnetmon.conf", testpath

inreplace testpath/"fastnetmon.conf", "/tmp/fastnetmon.dat", testpath/"fastnetmon.dat"

inreplace testpath/"fastnetmon.conf", "/tmp/fastnetmon_ipv6.dat", testpath/"fastnetmon_ipv6.dat"

fastnetmon_pid = fork do
exec opt_sbin/"fastnetmon",
"--configuration_file",
Expand All @@ -63,14 +67,14 @@ def install

sleep 15

assert_path_exists "/tmp/fastnetmon.dat"
assert_path_exists testpath/"fastnetmon.dat"

ipv4_stats_output = File.read("/tmp/fastnetmon.dat")
ipv4_stats_output = File.read(testpath/"fastnetmon.dat")
assert_match("Incoming traffic", ipv4_stats_output)

assert_path_exists "/tmp/fastnetmon_ipv6.dat"
assert_path_exists testpath/"fastnetmon_ipv6.dat"

ipv6_stats_output = File.read("/tmp/fastnetmon_ipv6.dat")
ipv6_stats_output = File.read(testpath/"fastnetmon_ipv6.dat")
assert_match("Incoming traffic", ipv6_stats_output)
ensure
Process.kill "SIGTERM", fastnetmon_pid
Expand Down

0 comments on commit 43ae1c9

Please sign in to comment.