Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.01.org
Subject: [PATCH] auto-t: fix hostapd.ungraceful_restart
Date: Mon, 13 Jul 2020 11:02:01 -0700	[thread overview]
Message-ID: <20200713180201.21931-1-prestwoj@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1055 bytes --]

This was killing hostapd, but not re-initializing any of the
control socket information so any use of hostapd.wait_for_event
after hostapd.ungraceful_restart would cause an exception.
---
 autotests/util/hostapd.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/autotests/util/hostapd.py b/autotests/util/hostapd.py
index 49047f38..c3a4a0d0 100644
--- a/autotests/util/hostapd.py
+++ b/autotests/util/hostapd.py
@@ -193,6 +193,8 @@ class HostapdCLI:
         '''
             Ungracefully kill and restart hostapd
         '''
+        self.ctrl_sock.close()
+
         intf = hostapd_map[self.ifname]
         os.system('killall -9 hostapd')
         os.system('ifconfig %s down' % intf.name)
@@ -203,6 +205,9 @@ class HostapdCLI:
         # set flag so hostapd can be killed after the test
         self._hostapd_restarted = True
 
+        # New hostapd process, so re-init
+        self.__init__(intf)
+
     def req_beacon(self, addr, request):
         '''
             Send a RRM Beacon request
-- 
2.21.1

                 reply	other threads:[~2020-07-13 18:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200713180201.21931-1-prestwoj@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=iwd@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox