Skip to content

Commit 2843160

Browse files
committed
Update to latest VintageNet
1 parent 5d1bef6 commit 2843160

File tree

3 files changed

+43
-11
lines changed

3 files changed

+43
-11
lines changed

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ defmodule VintageNetBridge.MixProject do
5454

5555
defp deps do
5656
[
57-
{:vintage_net, "~> 0.9.1"},
57+
{:vintage_net, "~> 0.10.0"},
5858
{:credo, "~> 1.2", only: :test, runtime: false},
5959
{:dialyxir, "~> 1.1.0", only: [:dev, :test], runtime: false},
6060
{:ex_doc, "~> 0.22", only: :docs, runtime: false},

mix.lock

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
%{
2+
"beam_notify": {:hex, :beam_notify, "0.2.0", "89dcf268e9ebbc988e7f37d05124d7099942507f497e1c0c828ea977d1db5a8f", [:make, :mix], [{:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "e0fbdaaca53e8d8b3c516b979728de5e69db8e9ddbc2d5193512e76fc845c7cd"},
23
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"},
34
"certifi": {:hex, :certifi, "2.6.1", "dbab8e5e155a0763eea978c913ca280a6b544bfa115633fa20249c3d396d9493", [:rebar3], [], "hexpm", "524c97b4991b3849dd5c17a631223896272c6b0af446778ba4675a1dff53bb7e"},
45
"credo": {:hex, :credo, "1.5.5", "e8f422026f553bc3bebb81c8e8bf1932f498ca03339856c7fec63d3faac8424b", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "dd8623ab7091956a855dc9f3062486add9c52d310dfd62748779c4315d8247de"},
@@ -23,5 +24,5 @@
2324
"parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"},
2425
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"},
2526
"unicode_util_compat": {:hex, :unicode_util_compat, "0.7.0", "bc84380c9ab48177092f43ac89e4dfa2c6d62b40b8bd132b1059ecc7232f9a78", [:rebar3], [], "hexpm", "25eee6d67df61960cf6a794239566599b09e17e668d3700247bc498638152521"},
26-
"vintage_net": {:hex, :vintage_net, "0.9.3", "6f023c73a4674eba3160d27f777847dbfb5c69abf87ee3b87ec0e0d410b73059", [:make, :mix], [{:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}, {:gen_state_machine, "~> 2.0.0 or ~> 2.1.0 or ~> 3.0.0", [hex: :gen_state_machine, repo: "hexpm", optional: false]}, {:muontrap, "~> 0.5.1 or ~> 0.6.0", [hex: :muontrap, repo: "hexpm", optional: false]}], "hexpm", "3e0094953aa0b36a6874b0dbb03cf02f45c275eca7bdf5386d17b702d869fda8"},
27+
"vintage_net": {:hex, :vintage_net, "0.10.0", "e199913a1b22cf7b5c625d4fc84cfa036000498bf46edaa388f7117847fcef97", [:make, :mix], [{:beam_notify, "~> 0.2.0", [hex: :beam_notify, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}, {:gen_state_machine, "~> 2.0.0 or ~> 2.1.0 or ~> 3.0.0", [hex: :gen_state_machine, repo: "hexpm", optional: false]}, {:muontrap, "~> 0.5.1 or ~> 0.6.0", [hex: :muontrap, repo: "hexpm", optional: false]}], "hexpm", "aa4a629ee5e64b4de0bd0a33539d9da385fe1d23f8474436e7a64a9590aa762f"},
2728
}

test/test_helper.exs

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,61 @@ defmodule Utils do
33

44
@spec default_opts() :: keyword()
55
def default_opts() do
6-
# Use the defaults in mix.exs, but normalize the paths to commands
76
Application.get_all_env(:vintage_net)
87
end
98

109
@spec udhcpc_child_spec(VintageNet.ifname(), String.t()) :: Supervisor.child_spec()
1110
def udhcpc_child_spec(ifname, hostname) do
11+
beam_notify = Application.app_dir(:beam_notify, "priv/beam_notify")
12+
env = BEAMNotify.env(name: "vintage_net_comm", report_env: true)
13+
1214
%{
1315
id: :udhcpc,
16+
start: {
17+
VintageNet.Interface.IfupDaemon,
18+
:start_link,
19+
[
20+
[
21+
ifname: ifname,
22+
command: "udhcpc",
23+
args: [
24+
"-f",
25+
"-i",
26+
ifname,
27+
"-x",
28+
"hostname:#{hostname}",
29+
"-s",
30+
beam_notify
31+
],
32+
opts: [
33+
stderr_to_stdout: true,
34+
log_output: :debug,
35+
log_prefix: "udhcpc(#{ifname}): ",
36+
env: env
37+
]
38+
]
39+
]
40+
}
41+
}
42+
end
43+
44+
@spec udhcpd_child_spec(VintageNet.ifname()) :: Supervisor.child_spec()
45+
def udhcpd_child_spec(ifname) do
46+
env = BEAMNotify.env(name: "vintage_net_comm", report_env: true)
47+
48+
%{
49+
id: :udhcpd,
1450
restart: :permanent,
1551
shutdown: 500,
1652
start:
1753
{MuonTrap.Daemon, :start_link,
1854
[
19-
"udhcpc",
55+
"udhcpd",
2056
[
2157
"-f",
22-
"-i",
23-
ifname,
24-
"-x",
25-
"hostname:#{hostname}",
26-
"-s",
27-
Application.app_dir(:vintage_net, ["priv", "udhcpc_handler"])
58+
"/tmp/vintage_net/udhcpd.conf.#{ifname}"
2859
],
29-
[stderr_to_stdout: true, log_output: :debug, log_prefix: "udhcpc(#{ifname}): "]
60+
[stderr_to_stdout: true, log_output: :debug, env: env]
3061
]},
3162
type: :worker
3263
}

0 commit comments

Comments
 (0)