All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.01.org
Subject: [PATCH 6/6] auto-t: add EAD autotest
Date: Thu, 17 Sep 2020 14:32:47 -0700	[thread overview]
Message-ID: <20200917213247.788181-6-prestwoj@gmail.com> (raw)
In-Reply-To: <20200917213247.788181-1-prestwoj@gmail.com>

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

---
 autotests/testEAD/connection_test.py | 35 ++++++++++++++++++++++++++++
 autotests/testEAD/default.8021x      |  7 ++++++
 autotests/testEAD/hw.conf            |  6 +++++
 autotests/testEAD/wired.conf         | 17 ++++++++++++++
 4 files changed, 65 insertions(+)
 create mode 100644 autotests/testEAD/connection_test.py
 create mode 100644 autotests/testEAD/default.8021x
 create mode 100644 autotests/testEAD/hw.conf
 create mode 100644 autotests/testEAD/wired.conf

diff --git a/autotests/testEAD/connection_test.py b/autotests/testEAD/connection_test.py
new file mode 100644
index 00000000..c51d7237
--- /dev/null
+++ b/autotests/testEAD/connection_test.py
@@ -0,0 +1,35 @@
+#!/usr/bin/python3
+
+import unittest
+import sys
+
+sys.path.append('../util')
+from iwd import IWD
+from config import ctx
+
+from ead import EAD
+
+class Test(unittest.TestCase):
+    def test_connection_success(self):
+        ctx.start_process(['ead', '-i', 'eth1', '-d'])
+
+        ead = EAD()
+
+        adapter = ead.list_adapters(1)[0]
+
+        condition = 'obj.connected == True'
+        ead.wait_for_object_condition(adapter, condition)
+
+        condition = 'obj.authenticated == True'
+        ead.wait_for_object_condition(adapter, condition)
+
+    @classmethod
+    def setUpClass(cls):
+        IWD.copy_to_storage('default.8021x', storage_dir='/var/lib/ead')
+
+    @classmethod
+    def tearDownClass(cls):
+        IWD.clear_storage()
+
+if __name__ == '__main__':
+    unittest.main(exit=True)
diff --git a/autotests/testEAD/default.8021x b/autotests/testEAD/default.8021x
new file mode 100644
index 00000000..55eb431d
--- /dev/null
+++ b/autotests/testEAD/default.8021x
@@ -0,0 +1,7 @@
+[Security]
+EAP-Method=MSCHAPV2
+EAP-Identity=domain\\User
+EAP-Password=Password
+
+[Settings]
+AutoConnect=false
diff --git a/autotests/testEAD/hw.conf b/autotests/testEAD/hw.conf
new file mode 100644
index 00000000..dee31f9e
--- /dev/null
+++ b/autotests/testEAD/hw.conf
@@ -0,0 +1,6 @@
+[SETUP]
+num_radios=0
+start_iwd=0
+
+[HOSTAPD]
+radius_server=wired.conf
diff --git a/autotests/testEAD/wired.conf b/autotests/testEAD/wired.conf
new file mode 100644
index 00000000..9e6ef638
--- /dev/null
+++ b/autotests/testEAD/wired.conf
@@ -0,0 +1,17 @@
+interface=eth0
+driver=wired
+logger_stdout=-1
+logger_stdout_level=1
+
+ieee8021x=1
+eap_reauth_period=3600
+
+use_pae_group_addr=1
+
+nas_identifier=ap.example.com
+
+radius_server_clients=/tmp/certs/radius-clients.text
+radius_server_auth_port=1812
+
+eap_user_file=/tmp/secrets/eap-user-mschapv2.text
+eap_server=1
-- 
2.26.2

      parent reply	other threads:[~2020-09-17 21:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17 21:32 [PATCH 1/6] auto-t: modify copy_to_storage to take optional dir James Prestwood
2020-09-17 21:20 ` Denis Kenzior
2020-09-17 21:32 ` [PATCH 2/6] doc: update hostapd.conf with DRIVER_WIRED James Prestwood
2020-09-17 21:32 ` [PATCH 3/6] auto-t: allow IWDDBusAbstract to work with any service James Prestwood
2020-09-17 21:32 ` [PATCH 4/6] auto-t: add ead.py module James Prestwood
2020-09-17 21:32 ` [PATCH 5/6] test-runner: allow EAD-based autotests James Prestwood
2020-09-17 21:32 ` James Prestwood [this message]

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=20200917213247.788181-6-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 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.