Skip to content

Commit

Permalink
finished renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
KiLLuuuhh committed Mar 21, 2024
1 parent dc242ff commit 378a95e
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 273 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,100 +9,100 @@

# Test User minimum requirements
- name: "Test User 1: Test minimum requirements User Creation"
puzzle.opnsense.users:
puzzle.opnsense.system_access_users:
username: test_user_1
password: test_password_1

# Test User minimum requirements disabled
- name: "Test User 2: Test disabled User Creation"
puzzle.opnsense.users:
puzzle.opnsense.system_access_users:
username: test_user_2
password: test_password_2
full_name: "Test User 2: Test disabled User Creation"
disabled: True

# Test User with Full Name
- name: "Test User 3: Test User Creation with Full Name"
puzzle.opnsense.users:
puzzle.opnsense.system_access_users:
username: test_user_3
password: test_password_3
full_name: "Test User 3: Test User Creation with Full Name"

# Test User with E-Mail
- name: "Test User 4: Test User Creation with E-Mail"
puzzle.opnsense.users:
puzzle.opnsense.system_access_users:
username: test_user_4
password: test_password_4
email: [email protected]
full_name: "Test User 4: Test User Creation with E-Mail"

# Test User with Comment
- name: "Test User 5: Test User Creation with Comment"
puzzle.opnsense.users:
puzzle.opnsense.system_access_users:
username: test_user_5
password: test_password_5
comment: Test User 5 Comment
full_name: "Test User 5: Test User Creation with Comment"

# Test User with Preferred landing page
- name: "Test User 6: Test User Creation with Preferred landing page"
puzzle.opnsense.users:
puzzle.opnsense.system_access_users:
username: test_user_6
password: test_password_6
landing_page: /ui/ipsec/sessions
full_name: "Test User 6: Test User Creation with Preferred landing page"

# Test User with nologin shell
- name: "Test User 7: Test User Creation with nologin shell"
puzzle.opnsense.users:
puzzle.opnsense.system_access_users:
username: test_user_7
password: test_password_7
shell: /sbin/nologin
full_name: "Test User 7: Test User Creation with nologin shell"

# Test User with csh shell
- name: "Test User 8: Test User Creation with csh shell"
puzzle.opnsense.users:
puzzle.opnsense.system_access_users:
username: test_user_8
password: test_password_8
shell: /bin/csh
full_name: "Test User 8: Test User Creation with csh shell"

# Test User with sh shell
- name: "Test User 9: Test User Creation with sh shell"
puzzle.opnsense.users:
puzzle.opnsense.system_access_users:
username: test_user_9
password: test_password_9
shell: /bin/sh
full_name: "Test User 9: Test User Creation with sh shell"

# Test User with tcsh shell
- name: "Test User 10: Test User Creation with tcsh shell"
puzzle.opnsense.users:
puzzle.opnsense.system_access_users:
username: test_user_10
password: test_password_10
shell: /bin/tcsh
full_name: "Test User 10: Test User Creation with tcsh shell"

# Test User with Expiration date
- name: "Test User 11: Test User Creation with Expiration date"
puzzle.opnsense.users:
puzzle.opnsense.system_access_users:
username: test_user_11
password: test_password_11
expires: 02/27/2024
full_name: "Test User 11: Test User Creation with Expiration date"

# Test User with group as string
- name: "Test User 12: Test User Creation with group as string"
puzzle.opnsense.users:
puzzle.opnsense.system_access_users:
username: test_user_12
password: test_password_12
full_name: "Test User 12: Test User Creation with group as string"
groups: admins

# Test User with group as list
- name: "Test User 13: Test User Creation with group as list"
puzzle.opnsense.users:
puzzle.opnsense.system_access_users:
username: test_user_13
password: test_password_13
full_name: "Test User 13: Test User Creation with group as list"
Expand All @@ -111,7 +111,7 @@

# Test User with not existing group as list
- name: "Test User 14: Test User Creation with not existing group as list"
puzzle.opnsense.users:
puzzle.opnsense.system_access_users:
username: test_user_14
password: test_password_14
full_name: "Test User 14: Test User Creation with not existing group as list"
Expand All @@ -129,39 +129,39 @@

# Test User with empty otp_seed
- name: "Test User 15: Test User Creation with empty otp_seed"
puzzle.opnsense.users:
puzzle.opnsense.system_access_users:
username: test_user_15
password: test_password_15
otp_seed: ""
full_name: "Test User 15: Test User Creation with empty otp_seed"

# Test User with otp_seed
- name: "Test User 16: Test User Creation with otp_seed"
puzzle.opnsense.users:
puzzle.opnsense.system_access_users:
username: test_user_16
password: test_password_16
otp_seed: test_seed
full_name: "Test User 16: Test User Creation with otp_seed"

# Test User with empty authorizedkeys
- name: "Test User 17: Test User Creation with empty authorizedkeys"
puzzle.opnsense.users:
puzzle.opnsense.system_access_users:
username: test_user_17
password: test_password_17
authorizedkeys: ""
full_name: "Test User 17: Test User Creation with empty authorizedkeys"

# Test User with authorizedkeys
- name: "Test User 18: Test User Creation with authorizedkeys"
puzzle.opnsense.users:
puzzle.opnsense.system_access_users:
username: test_user_18
password: test_password_18
authorizedkeys: test_authorized_key
full_name: "Test User 18: Test User Creation with authorizedkeys"

# Test User with api_keys
- name: "Test User 19: Test User Creation with api_keys"
puzzle.opnsense.users:
puzzle.opnsense.system_access_users:
username: test_user_19
password: test_password_19
apikeys: ""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
scenario:
name: users
name: system_access_users
test_sequence:
# - dependency not relevant unless we have requirements
- destroy
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions plugins/module_utils/module_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
},
},
},
"users": {
"system_access_users": {
"users": "system/user",
"uid": "system/nextuid",
"gid": "system/nextgid",
Expand Down Expand Up @@ -185,7 +185,7 @@
},
},
},
"users": {
"system_access_users": {
"users": "system/user",
"uid": "system/nextuid",
"gid": "system/nextgid",
Expand Down Expand Up @@ -273,7 +273,7 @@
},
},
},
"users": {
"system_access_users": {
"users": "system/user",
"uid": "system/nextuid",
"gid": "system/nextgid",
Expand Down
2 changes: 1 addition & 1 deletion plugins/module_utils/users_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ class UserSet(OPNsenseModuleConfig):
_users: List[User]

def __init__(self, path: str = "/conf/config.xml"):
super().__init__(module_name="users", path=path)
super().__init__(module_name="system_access_users", path=path)
self._users = self._load_users()
self._groups = self._load_groups()

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/system_access_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)


"""User module: Read, write, edit operations for OPNsense Users """
"""system_access_users module: Read, write, edit operations for OPNsense Users """

__metaclass__ = type

Expand Down
Loading

0 comments on commit 378a95e

Please sign in to comment.