Skip to content

Commit

Permalink
Fix iPadOS user enrollment command verification
Browse files Browse the repository at this point in the history
  • Loading branch information
np5 committed May 15, 2024
1 parent 4cddc04 commit ae9f79a
Show file tree
Hide file tree
Showing 20 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions tests/mdm/test_certificate_list_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ def test_scope_user_enrollment_ios_ok(self):
self.enrolled_device
))

def test_scope_user_enrollment_ipados_not_ok(self):
def test_scope_user_enrollment_ipados_ok(self):
self.enrolled_device.platform = Platform.IPADOS
self.enrolled_device.user_enrollment = True
self.assertFalse(CertificateList.verify_channel_and_device(
self.assertTrue(CertificateList.verify_channel_and_device(
Channel.DEVICE,
self.enrolled_device
))
Expand Down
2 changes: 1 addition & 1 deletion tests/mdm/test_device_information_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_scope(self):
(Channel.USER, Platform.MACOS, False, True),
(Channel.USER, Platform.TVOS, False, False),
(Channel.DEVICE, Platform.IOS, True, True),
(Channel.DEVICE, Platform.IPADOS, True, False),
(Channel.DEVICE, Platform.IPADOS, True, True),
(Channel.DEVICE, Platform.MACOS, True, True),
(Channel.DEVICE, Platform.TVOS, True, False),
):
Expand Down
2 changes: 1 addition & 1 deletion tests/mdm/test_install_application_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def test_scope(self):
(Channel.USER, Platform.MACOS, False, True),
(Channel.USER, Platform.TVOS, False, False),
(Channel.DEVICE, Platform.IOS, True, True),
(Channel.DEVICE, Platform.IPADOS, True, False),
(Channel.DEVICE, Platform.IPADOS, True, True),
(Channel.DEVICE, Platform.MACOS, True, True),
(Channel.DEVICE, Platform.TVOS, True, False),
):
Expand Down
4 changes: 2 additions & 2 deletions tests/mdm/test_install_profile_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ def test_scope(self):
(Channel.USER, Platform.MACOS, False, True),
(Channel.USER, Platform.TVOS, False, False),
(Channel.DEVICE, Platform.IOS, True, True),
(Channel.DEVICE, Platform.IPADOS, True, False),
(Channel.DEVICE, Platform.IPADOS, True, True),
(Channel.DEVICE, Platform.MACOS, True, True),
(Channel.DEVICE, Platform.TVOS, True, False),
(Channel.USER, Platform.IOS, True, False),
(Channel.USER, Platform.IPADOS, True, False),
(Channel.USER, Platform.IPADOS, True, True),
(Channel.USER, Platform.MACOS, True, True),
(Channel.USER, Platform.TVOS, True, False),
):
Expand Down
2 changes: 1 addition & 1 deletion tests/mdm/test_installed_application_list_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_scope(self):
(Channel.USER, Platform.MACOS, False, True),
(Channel.USER, Platform.TVOS, False, False),
(Channel.DEVICE, Platform.IOS, True, True),
(Channel.DEVICE, Platform.IPADOS, True, False),
(Channel.DEVICE, Platform.IPADOS, True, True),
(Channel.DEVICE, Platform.MACOS, True, False),
(Channel.DEVICE, Platform.TVOS, True, False),
(Channel.USER, Platform.IOS, True, False),
Expand Down
2 changes: 1 addition & 1 deletion tests/mdm/test_managed_application_list_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def test_scope(self):
(Channel.USER, Platform.MACOS, False, True),
(Channel.USER, Platform.TVOS, False, False),
(Channel.DEVICE, Platform.IOS, True, True),
(Channel.DEVICE, Platform.IPADOS, True, False),
(Channel.DEVICE, Platform.IPADOS, True, True),
(Channel.DEVICE, Platform.MACOS, True, True),
(Channel.DEVICE, Platform.TVOS, True, False),
(Channel.USER, Platform.IOS, True, False),
Expand Down
4 changes: 2 additions & 2 deletions tests/mdm/test_profile_list_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ def test_scope(self):
(Channel.USER, Platform.MACOS, False, True),
(Channel.USER, Platform.TVOS, False, False),
(Channel.DEVICE, Platform.IOS, True, True),
(Channel.DEVICE, Platform.IPADOS, True, False),
(Channel.DEVICE, Platform.IPADOS, True, True),
(Channel.DEVICE, Platform.MACOS, True, True),
(Channel.DEVICE, Platform.TVOS, True, False),
(Channel.USER, Platform.IOS, True, False),
(Channel.USER, Platform.IPADOS, True, False),
(Channel.USER, Platform.IPADOS, True, True),
(Channel.USER, Platform.MACOS, True, True),
(Channel.USER, Platform.TVOS, True, False),
):
Expand Down
2 changes: 1 addition & 1 deletion tests/mdm/test_remove_application_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def test_scope(self):
(Channel.USER, Platform.MACOS, False, False),
(Channel.USER, Platform.TVOS, False, False),
(Channel.DEVICE, Platform.IOS, True, True),
(Channel.DEVICE, Platform.IPADOS, True, False),
(Channel.DEVICE, Platform.IPADOS, True, True),
(Channel.DEVICE, Platform.MACOS, True, False),
(Channel.DEVICE, Platform.TVOS, True, False),
(Channel.USER, Platform.IOS, True, False),
Expand Down
4 changes: 2 additions & 2 deletions tests/mdm/test_remove_profile_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ def test_scope(self):
(Channel.USER, Platform.MACOS, False, True),
(Channel.USER, Platform.TVOS, False, False),
(Channel.DEVICE, Platform.IOS, True, True),
(Channel.DEVICE, Platform.IPADOS, True, False),
(Channel.DEVICE, Platform.IPADOS, True, True),
(Channel.DEVICE, Platform.MACOS, True, True),
(Channel.DEVICE, Platform.TVOS, True, False),
(Channel.USER, Platform.IOS, True, False),
(Channel.USER, Platform.IPADOS, True, False),
(Channel.USER, Platform.IPADOS, True, True),
(Channel.USER, Platform.MACOS, True, True),
(Channel.USER, Platform.TVOS, True, False),
):
Expand Down
2 changes: 1 addition & 1 deletion tests/mdm/test_security_info_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_scope(self):
(Channel.USER, Platform.MACOS, False, False),
(Channel.USER, Platform.TVOS, False, False),
(Channel.DEVICE, Platform.IOS, True, True),
(Channel.DEVICE, Platform.IPADOS, True, False),
(Channel.DEVICE, Platform.IPADOS, True, True),
(Channel.DEVICE, Platform.MACOS, True, True),
(Channel.DEVICE, Platform.TVOS, True, False),
):
Expand Down
2 changes: 1 addition & 1 deletion zentral/contrib/mdm/commands/certificate_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def verify_channel_and_device(channel, enrolled_device):
channel == Channel.DEVICE
and (
not enrolled_device.user_enrollment
or enrolled_device.platform in (Platform.IOS, Platform.MACOS)
or enrolled_device.platform in (Platform.IOS, Platform.IPADOS, Platform.MACOS)
)
)

Expand Down
2 changes: 1 addition & 1 deletion zentral/contrib/mdm/commands/device_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def verify_channel_and_device(channel, enrolled_device):
or enrolled_device.platform in (Platform.MACOS, Platform.IPADOS)
) and (
not enrolled_device.user_enrollment
or enrolled_device.platform in (Platform.IOS, Platform.MACOS)
or enrolled_device.platform in (Platform.IOS, Platform.IPADOS, Platform.MACOS)
)
)

Expand Down
2 changes: 1 addition & 1 deletion zentral/contrib/mdm/commands/install_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def verify_channel_and_device(channel, enrolled_device):
or enrolled_device.platform == Platform.MACOS
) and (
not enrolled_device.user_enrollment
or enrolled_device.platform in (Platform.IOS, Platform.MACOS)
or enrolled_device.platform in (Platform.IOS, Platform.IPADOS, Platform.MACOS)
)
)

Expand Down
2 changes: 1 addition & 1 deletion zentral/contrib/mdm/commands/install_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def verify_channel_and_device(channel, enrolled_device):
or enrolled_device.platform in (Platform.IPADOS, Platform.MACOS)
) and (
not enrolled_device.user_enrollment
or enrolled_device.platform in (Platform.IOS, Platform.MACOS)
or enrolled_device.platform in (Platform.IOS, Platform.IPADOS, Platform.MACOS)
)
)

Expand Down
2 changes: 1 addition & 1 deletion zentral/contrib/mdm/commands/installed_application_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def verify_channel_and_device(channel, enrolled_device):
or enrolled_device.platform == Platform.MACOS
) and (
not enrolled_device.user_enrollment
or enrolled_device.platform == Platform.IOS
or enrolled_device.platform in (Platform.IOS, Platform.IPADOS)
)
)

Expand Down
2 changes: 1 addition & 1 deletion zentral/contrib/mdm/commands/managed_application_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def verify_channel_and_device(channel, enrolled_device):
or enrolled_device.platform == Platform.MACOS
) and (
not enrolled_device.user_enrollment
or enrolled_device.platform in (Platform.IOS, Platform.MACOS)
or enrolled_device.platform in (Platform.IOS, Platform.IPADOS, Platform.MACOS)
)
)

Expand Down
2 changes: 1 addition & 1 deletion zentral/contrib/mdm/commands/profile_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def verify_channel_and_device(channel, enrolled_device):
or enrolled_device.platform in (Platform.IPADOS, Platform.MACOS)
) and (
not enrolled_device.user_enrollment
or enrolled_device.platform in (Platform.IOS, Platform.MACOS)
or enrolled_device.platform in (Platform.IOS, Platform.IPADOS, Platform.MACOS)
)
)

Expand Down
2 changes: 1 addition & 1 deletion zentral/contrib/mdm/commands/remove_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def verify_channel_and_device(channel, enrolled_device):
channel == Channel.DEVICE
and (
not enrolled_device.user_enrollment
or enrolled_device.platform == Platform.IOS
or enrolled_device.platform in (Platform.IOS, Platform.IPADOS)
)
)

Expand Down
2 changes: 1 addition & 1 deletion zentral/contrib/mdm/commands/remove_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def verify_channel_and_device(channel, enrolled_device):
or enrolled_device.platform in (Platform.IPADOS, Platform.MACOS)
) and (
not enrolled_device.user_enrollment
or enrolled_device.platform in (Platform.IOS, Platform.MACOS)
or enrolled_device.platform in (Platform.IOS, Platform.IPADOS, Platform.MACOS)
)
)

Expand Down
2 changes: 1 addition & 1 deletion zentral/contrib/mdm/commands/security_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def verify_channel_and_device(channel, enrolled_device):
channel == Channel.DEVICE
and (
not enrolled_device.user_enrollment
or enrolled_device.platform in (Platform.IOS, Platform.MACOS)
or enrolled_device.platform in (Platform.IOS, Platform.IPADOS, Platform.MACOS)
)
)

Expand Down

0 comments on commit ae9f79a

Please sign in to comment.