summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Lemenkov <lemenkov@redhat.com>2017-04-12 12:40:39 +0200
committerPeter Lemenkov <lemenkov@redhat.com>2017-04-12 15:20:28 +0200
commitf4d0613e53b0df0a0b5de1838a0c7d84ca7565da (patch)
tree160e4577b931c686f766f243c6e369b6f3a8415a
parente3c98ad422c7097dd2601f2d096315ffad889412 (diff)
downloaderlang-sd_notify-f4d0613e53b0df0a0b5de1838a0c7d84ca7565da.tar.gz
Move test message creation to where it belongs
Signed-off-by: Peter Lemenkov <lemenkov@redhat.com>
-rw-r--r--test/sd_notify_test.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/sd_notify_test.erl b/test/sd_notify_test.erl
index 32a8ac6..414f1bc 100644
--- a/test/sd_notify_test.erl
+++ b/test/sd_notify_test.erl
@@ -9,7 +9,6 @@ sd_notify_test_() ->
sd_notify_test_local("19") ->
{ok, CWD} = file:get_cwd(),
FakeNotifyUnixSockName = CWD ++ "/fake-notify-udp-sock-" ++ integer_to_list(erlang:phash2(make_ref())),
- TestMessage = integer_to_list(erlang:phash2(make_ref())),
{ok, FakeNotifyUnixSock} = gen_udp:open(0, [{ifaddr, {local, FakeNotifyUnixSockName}}, {active, false}, list]),
os:putenv("NOTIFY_SOCKET", FakeNotifyUnixSockName),
@@ -20,6 +19,7 @@ sd_notify_test_local("19") ->
{
"Try sending message",
fun() ->
+ TestMessage = integer_to_list(erlang:phash2(make_ref())),
sd_notify:sd_pid_notify_with_fds(0, 0, TestMessage, [1, 2, 3]),
{ok, {_Address, _Port, Packet}} = gen_udp:recv(FakeNotifyUnixSock, length(TestMessage), 1000),
?assertEqual(TestMessage, Packet)