All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] ap: make APRanges optional
@ 2020-11-03 19:06 James Prestwood
  2020-11-03 19:06 ` [PATCH 2/4] auto-t: fix testNetconfig hardcoded interface James Prestwood
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: James Prestwood @ 2020-11-03 19:06 UTC (permalink / raw)
  To: iwd

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

If EnableNetworkConfiguration was enabled ap.c required that
APRanges also be set. This prevents IWD from starting which
effects a perfectly valid station configuration. Instead if
APRanges is not provided IWD still allows ap_init to pass but
DHCP just will not be enabled.
---
 src/ap.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/ap.c b/src/ap.c
index bebd7295..4d0d5686 100644
--- a/src/ap.c
+++ b/src/ap.c
@@ -3028,9 +3028,14 @@ static int ap_init(void)
 
 		ip_prefix = l_settings_get_string(settings, "General",
 							"APRanges");
+		/*
+		 * In this case its assumed the user only cares about station
+		 * netconfig so we let ap_init pass but DHCP will not be
+		 * enabled.
+		 */
 		if (!ip_prefix) {
-			l_error("[General].APRanges must be set for DHCP");
-			return -EINVAL;
+			l_warn("[General].APRanges must be set for DHCP");
+			return 0;
 		}
 
 		if (!ip_pool_create(ip_prefix))
-- 
2.26.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/4] auto-t: fix testNetconfig hardcoded interface
  2020-11-03 19:06 [PATCH 1/4] ap: make APRanges optional James Prestwood
@ 2020-11-03 19:06 ` James Prestwood
  2020-11-03 19:06 ` [PATCH 3/4] auto-t: remove /var/lib/iwd references in testKnownNetworks James Prestwood
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: James Prestwood @ 2020-11-03 19:06 UTC (permalink / raw)
  To: iwd

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

If running multiple tests testNetconfig would fail due to the
hardcoded wln0 in the dhcpd.conf file. dhcpd can actually start
by passing in the interface to the run command rather than
inside the config file.
---
 autotests/testNetconfig/connection_test.py | 3 ++-
 autotests/testNetconfig/dhcpd.conf         | 1 -
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/autotests/testNetconfig/connection_test.py b/autotests/testNetconfig/connection_test.py
index 6818ceff..5fc7a88e 100644
--- a/autotests/testNetconfig/connection_test.py
+++ b/autotests/testNetconfig/connection_test.py
@@ -62,7 +62,8 @@ class Test(unittest.TestCase):
         ctx.start_process(['ifconfig', hapd.ifname, '192.168.1.1', 'netmask', '255.255.255.0'],
                                 wait=True)
         ctx.start_process(['touch', '/tmp/dhcpd.leases'], wait=True)
-        ctx.start_process(['dhcpd', '-cf', '/tmp/dhcpd.conf', '-lf', '/tmp/dhcpd.leases'])
+        ctx.start_process(['dhcpd', '-cf', '/tmp/dhcpd.conf', '-lf', '/tmp/dhcpd.leases',
+                            hapd.ifname])
 
     @classmethod
     def tearDownClass(cls):
diff --git a/autotests/testNetconfig/dhcpd.conf b/autotests/testNetconfig/dhcpd.conf
index 77b4da1c..0c4fe9b9 100644
--- a/autotests/testNetconfig/dhcpd.conf
+++ b/autotests/testNetconfig/dhcpd.conf
@@ -10,7 +10,6 @@ subnet 192.168.1.0 netmask 255.255.255.0
   option routers 192.168.1.1;
   option subnet-mask 255.255.255.0;
   option domain-name-servers 192.168.1.1;
-  interface wln0;
   range 192.168.1.10 192.168.1.20;
   range 192.168.1.100 192.168.1.200;
  }
-- 
2.26.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/4] auto-t: remove /var/lib/iwd references in testKnownNetworks
  2020-11-03 19:06 [PATCH 1/4] ap: make APRanges optional James Prestwood
  2020-11-03 19:06 ` [PATCH 2/4] auto-t: fix testNetconfig hardcoded interface James Prestwood
@ 2020-11-03 19:06 ` James Prestwood
  2020-11-03 19:06 ` [PATCH 4/4] auto-t: fix agent path timing issue James Prestwood
  2020-11-03 19:59 ` [PATCH 1/4] ap: make APRanges optional Denis Kenzior
  3 siblings, 0 replies; 5+ messages in thread
From: James Prestwood @ 2020-11-03 19:06 UTC (permalink / raw)
  To: iwd

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

---
 autotests/testKnownNetworks/frequency_test.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/autotests/testKnownNetworks/frequency_test.py b/autotests/testKnownNetworks/frequency_test.py
index f07074f2..9c523bb2 100644
--- a/autotests/testKnownNetworks/frequency_test.py
+++ b/autotests/testKnownNetworks/frequency_test.py
@@ -67,7 +67,7 @@ class Test(unittest.TestCase):
         hs20_freqs = None
         hs20_uuid = None
         config = ConfigParser()
-        config.read('/var/lib/iwd/.known_network.freq')
+        config.read('/tmp/iwd/.known_network.freq')
         for s in config.sections():
             if os.path.basename(config[s]['name']) == 'ssidCCMP.psk':
                 psk_freqs = config[s]['list']
@@ -116,7 +116,7 @@ class Test(unittest.TestCase):
         psk_uuid2 = None
         hs20_freqs = None
         config = ConfigParser()
-        config.read('/var/lib/iwd/.known_network.freq')
+        config.read('/tmp/iwd/.known_network.freq')
         for s in config.sections():
             self.assertNotEqual(os.path.basename(config[s]['name']),
                                     'example.conf')
-- 
2.26.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/4] auto-t: fix agent path timing issue
  2020-11-03 19:06 [PATCH 1/4] ap: make APRanges optional James Prestwood
  2020-11-03 19:06 ` [PATCH 2/4] auto-t: fix testNetconfig hardcoded interface James Prestwood
  2020-11-03 19:06 ` [PATCH 3/4] auto-t: remove /var/lib/iwd references in testKnownNetworks James Prestwood
@ 2020-11-03 19:06 ` James Prestwood
  2020-11-03 19:59 ` [PATCH 1/4] ap: make APRanges optional Denis Kenzior
  3 siblings, 0 replies; 5+ messages in thread
From: James Prestwood @ 2020-11-03 19:06 UTC (permalink / raw)
  To: iwd

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

The agent path was generated based on the current time which
sometimes yielded duplicate paths if agents were created quickly
after one another. Instead a simple iterator removes any chance
of a duplicate path.
---
 autotests/util/iwd.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/autotests/util/iwd.py b/autotests/util/iwd.py
index 7b08c23e..3ffd9f23 100755
--- a/autotests/util/iwd.py
+++ b/autotests/util/iwd.py
@@ -705,17 +705,22 @@ class OrderedNetwork(object):
                         str(self.signal_strength)) + '\n'\
                 '\tObject: \n' + self.network_object.__str__('\t\t')
 
+agent_count = 0
 
 class PSKAgent(dbus.service.Object):
 
     def __init__(self, passphrases=[], users=[]):
+        global agent_count
+
         if type(passphrases) != list:
             passphrases = [passphrases]
         self.passphrases = passphrases
         if type(users) != list:
             users = [users]
         self.users = users
-        self._path = '/test/agent/' + str(int(round(time.time() * 1000)))
+        self._path = '/test/agent/%s' % agent_count
+
+        agent_count += 1
 
         dbus.service.Object.__init__(self, dbus.SystemBus(), self._path)
 
-- 
2.26.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/4] ap: make APRanges optional
  2020-11-03 19:06 [PATCH 1/4] ap: make APRanges optional James Prestwood
                   ` (2 preceding siblings ...)
  2020-11-03 19:06 ` [PATCH 4/4] auto-t: fix agent path timing issue James Prestwood
@ 2020-11-03 19:59 ` Denis Kenzior
  3 siblings, 0 replies; 5+ messages in thread
From: Denis Kenzior @ 2020-11-03 19:59 UTC (permalink / raw)
  To: iwd

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

Hi James,

On 11/3/20 1:06 PM, James Prestwood wrote:
> If EnableNetworkConfiguration was enabled ap.c required that
> APRanges also be set. This prevents IWD from starting which
> effects a perfectly valid station configuration. Instead if
> APRanges is not provided IWD still allows ap_init to pass but
> DHCP just will not be enabled.
> ---
>   src/ap.c | 9 +++++++--
>   1 file changed, 7 insertions(+), 2 deletions(-)
> 

All applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-03 19:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-03 19:06 [PATCH 1/4] ap: make APRanges optional James Prestwood
2020-11-03 19:06 ` [PATCH 2/4] auto-t: fix testNetconfig hardcoded interface James Prestwood
2020-11-03 19:06 ` [PATCH 3/4] auto-t: remove /var/lib/iwd references in testKnownNetworks James Prestwood
2020-11-03 19:06 ` [PATCH 4/4] auto-t: fix agent path timing issue James Prestwood
2020-11-03 19:59 ` [PATCH 1/4] ap: make APRanges optional Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.