Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
truenas-rk3588
truenas
Commits
0c33dae1
Commit
0c33dae1
authored
1 year ago
by
Caleb
Browse files
Options
Download
Email Patches
Plain Diff
sigh add back sys.path to some modules
parent
22e5c624
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
tests/api2/test_011_user.py
+6
-0
tests/api2/test_011_user.py
tests/api2/test_012_directory_service_ssh.py
+9
-2
tests/api2/test_012_directory_service_ssh.py
tests/api2/test_030_activedirectory.py
+8
-3
tests/api2/test_030_activedirectory.py
tests/api2/test_032_ad_kerberos.py
+9
-3
tests/api2/test_032_ad_kerberos.py
tests/api2/test_035_ad_idmap.py
+7
-1
tests/api2/test_035_ad_idmap.py
tests/api2/test_036_ad_ldap.py
+11
-3
tests/api2/test_036_ad_ldap.py
tests/api2/test_040_ad_user_group_cache.py
+8
-0
tests/api2/test_040_ad_user_group_cache.py
tests/api2/test_200_ftp.py
+10
-7
tests/api2/test_200_ftp.py
tests/api2/test_261_iscsi_cmd.py
+7
-2
tests/api2/test_261_iscsi_cmd.py
tests/api2/test_275_ldap.py
+9
-2
tests/api2/test_275_ldap.py
tests/api2/test_278_freeipa.py
+8
-0
tests/api2/test_278_freeipa.py
tests/api2/test_340_pool_dataset.py
+8
-1
tests/api2/test_340_pool_dataset.py
tests/api2/test_425_smb_protocol.py
+7
-3
tests/api2/test_425_smb_protocol.py
tests/api2/test_430_smb_sharesec.py
+9
-2
tests/api2/test_430_smb_sharesec.py
tests/api2/test_438_snapshots.py
+8
-0
tests/api2/test_438_snapshots.py
with
124 additions
and
29 deletions
+124
-29
tests/api2/test_011_user.py
View file @
0c33dae1
import
json
import
os
import
sys
import
time
import
stat
from
contextlib
import
contextmanager
...
...
@@ -7,6 +8,11 @@ from contextlib import contextmanager
import
pytest
from
pytest_dependency
import
depends
# TODO: we alreay have an assets module in middlewared.test.integration
# so move this there to prevent the sys.path alteration nonsense.
# This has to be done because the local assets directory isn't in python
# PATH since these tests aren't installed as a python "package"
sys
.
path
.
append
(
os
.
getcwd
())
from
assets.REST.pool
import
dataset
as
tmp_dataset
from
functions
import
POST
,
GET
,
DELETE
,
PUT
,
SSH_TEST
,
wait_on_job
from
auto_config
import
pool_name
,
ha
,
password
,
user
,
ip
...
...
This diff is collapsed.
Click to expand it.
tests/api2/test_012_directory_service_ssh.py
View file @
0c33dae1
import
os
import
sys
import
pytest
from
functions
import
SSH_TEST
from
auto_config
import
hostname
,
ip
from
assets.REST.directory_services
import
active_directory
,
ldap
,
override_nameservers
from
middlewared.test.integration.utils
import
call
# TODO: we alreay have an assets module in middlewared.test.integration
# so move this there to prevent the sys.path alteration nonsense.
# This has to be done because the local assets directory isn't in python
# PATH since these tests aren't installed as a python "package"
sys
.
path
.
append
(
os
.
getcwd
())
from
assets.REST.directory_services
import
active_directory
,
ldap
,
override_nameservers
try
:
from
config
import
AD_DOMAIN
,
ADPASSWORD
,
ADUSERNAME
,
ADNameServer
except
ImportError
:
...
...
This diff is collapsed.
Click to expand it.
tests/api2/test_030_activedirectory.py
View file @
0c33dae1
import
os
import
sys
import
ipaddress
from
time
import
sleep
import
pytest
from
pytest_dependency
import
depends
from
assets.REST.directory_services
import
active_directory
,
override_nameservers
from
assets.REST.pool
import
dataset
# TODO: we alreay have an assets module in middlewared.test.integration
# so move this there to prevent the sys.path alteration nonsense.
# This has to be done because the local assets directory isn't in python
# PATH since these tests aren't installed as a python "package"
sys
.
path
.
append
(
os
.
getcwd
())
from
auto_config
import
pool_name
,
ip
,
user
,
password
,
ha
from
functions
import
GET
,
POST
,
SSH_TEST
,
make_ws_request
from
protocols
import
smb_connection
,
smb_share
from
middlewared.test.integration.assets.privilege
import
privilege
from
middlewared.test.integration.utils
import
call
,
client
from
assets.REST.directory_services
import
active_directory
,
override_nameservers
from
assets.REST.pool
import
dataset
if
ha
and
"hostname_virtual"
in
os
.
environ
:
hostname
=
os
.
environ
[
"hostname_virtual"
]
else
:
...
...
This diff is collapsed.
Click to expand it.
tests/api2/test_032_ad_kerberos.py
View file @
0c33dae1
import
os
import
sys
import
time
from
calendar
import
timegm
from
contextlib
import
contextmanager
...
...
@@ -6,12 +8,16 @@ from base64 import b64decode
import
pytest
from
pytest_dependency
import
depends
from
assets.REST.directory_services
import
active_directory
from
assets.REST.pool
import
dataset
# TODO: we alreay have an assets module in middlewared.test.integration
# so move this there to prevent the sys.path alteration nonsense.
# This has to be done because the local assets directory isn't in python
# PATH since these tests aren't installed as a python "package"
sys
.
path
.
append
(
os
.
getcwd
())
from
functions
import
make_ws_request
,
PUT
,
POST
,
GET
,
DELETE
,
SSH_TEST
,
wait_on_job
from
auto_config
import
pool_name
,
ip
,
hostname
,
password
,
user
from
protocols
import
nfs_share
from
assets.REST.directory_services
import
active_directory
from
assets.REST.pool
import
dataset
try
:
from
config
import
AD_DOMAIN
,
ADPASSWORD
,
ADUSERNAME
,
ADNameServer
except
ImportError
:
...
...
This diff is collapsed.
Click to expand it.
tests/api2/test_035_ad_idmap.py
View file @
0c33dae1
import
os
import
sys
from
base64
import
b64decode
import
json
from
time
import
sleep
import
pytest
from
pytest_dependency
import
depends
# TODO: we alreay have an assets module in middlewared.test.integration
# so move this there to prevent the sys.path alteration nonsense.
# This has to be done because the local assets directory isn't in python
# PATH since these tests aren't installed as a python "package"
sys
.
path
.
append
(
os
.
getcwd
())
from
functions
import
PUT
,
POST
,
GET
,
DELETE
,
SSH_TEST
,
wait_on_job
from
assets.REST.directory_services
import
active_directory
,
override_nameservers
from
auto_config
import
dev_test
,
ip
,
hostname
,
password
,
user
...
...
This diff is collapsed.
Click to expand it.
tests/api2/test_036_ad_ldap.py
View file @
0c33dae1
from
contextlib
import
contextmanager
import
os
import
sys
import
pytest
from
pytest_dependency
import
depends
from
assets.REST.directory_services
import
active_directory
,
ldap
,
override_nameservers
from
assets.REST.pool
import
dataset
# TODO: we alreay have an assets module in middlewared.test.integration
# so move this there to prevent the sys.path alteration nonsense.
# This has to be done because the local assets directory isn't in python
# PATH since these tests aren't installed as a python "package"
sys
.
path
.
append
(
os
.
getcwd
())
from
auto_config
import
dev_test
,
ip
,
hostname
,
password
,
pool_name
,
user
,
ha
from
functions
import
GET
,
POST
,
PUT
,
SSH_TEST
,
make_ws_request
,
wait_on_job
from
protocols
import
nfs_share
,
SSH_NFS
from
middlewared.test.integration.utils
import
call
from
middlewared.test.integration.assets.REST.pool
import
dataset
from
middlewared.test.integration.assets.REST.directory_services
import
(
active_directory
,
ldap
,
override_nameservers
)
try
:
from
config
import
AD_DOMAIN
,
ADPASSWORD
,
ADUSERNAME
,
ADNameServer
except
ImportError
:
...
...
This diff is collapsed.
Click to expand it.
tests/api2/test_040_ad_user_group_cache.py
View file @
0c33dae1
import
os
import
sys
import
pytest
from
pytest_dependency
import
depends
# TODO: we alreay have an assets module in middlewared.test.integration
# so move this there to prevent the sys.path alteration nonsense.
# This has to be done because the local assets directory isn't in python
# PATH since these tests aren't installed as a python "package"
sys
.
path
.
append
(
os
.
getcwd
())
from
functions
import
GET
,
SSH_TEST
,
wait_on_job
from
assets.REST.directory_services
import
active_directory
,
override_nameservers
from
auto_config
import
dev_test
,
ip
,
hostname
,
password
,
user
...
...
This diff is collapsed.
Click to expand it.
tests/api2/test_200_ftp.py
View file @
0c33dae1
import
os
import
sys
import
json
import
contextlib
import
copy
...
...
@@ -11,14 +12,16 @@ from types import SimpleNamespace
import
pytest
from
pytest_dependency
import
depends
from
assets.REST.pool
import
dataset
as
ftp_dataset
from
functions
import
SSH_TEST
from
functions
import
make_ws_request
,
send_file
from
auto_config
import
pool_name
,
ha
from
auto_config
import
dev_test
,
password
,
user
from
protocols
import
ftp_connect
,
ftp_connection
from
protocols
import
ftps_connection
# TODO: we alreay have an assets module in middlewared.test.integration
# so move this there to prevent the sys.path alteration nonsense.
# This has to be done because the local assets directory isn't in python
# PATH since these tests aren't installed as a python "package"
sys
.
path
.
append
(
os
.
getcwd
())
from
functions
import
SSH_TEST
,
make_ws_request
,
send_file
from
auto_config
import
pool_name
,
ha
,
dev_test
,
password
,
user
from
protocols
import
ftps_connection
,
ftp_connect
,
ftp_connection
from
middlewared.test.integration.assets.account
import
user
as
ftp_user
from
middlewared.test.integration.assets.REST.pool
import
dataset
as
ftp_dataset
# comment pytestmark for development testing with --dev-test
pytestmark
=
pytest
.
mark
.
skipif
(
dev_test
,
reason
=
'Skipping for test development testing'
)
...
...
This diff is collapsed.
Click to expand it.
tests/api2/test_261_iscsi_cmd.py
View file @
0c33dae1
import
contextlib
import
enum
import
os
import
sys
import
random
import
socket
import
string
...
...
@@ -12,12 +13,16 @@ import pytest
from
pyscsi.pyscsi.scsi_sense
import
sense_ascq_dict
from
pytest_dependency
import
depends
# TODO: we alreay have an assets module in middlewared.test.integration
# so move this there to prevent the sys.path alteration nonsense.
# This has to be done because the local assets directory isn't in python
# PATH since these tests aren't installed as a python "package"
sys
.
path
.
append
(
os
.
getcwd
())
from
auto_config
import
dev_test
,
ha
,
hostname
,
isns_ip
,
pool_name
from
functions
import
DELETE
,
GET
,
POST
,
PUT
from
protocols
import
initiator_name_supported
,
iscsi_scsi_connection
,
isns_connection
from
assets.REST.pool
import
dataset
from
assets.REST.snapshot
import
snapshot
,
snapshot_rollback
from
assets.REST.pool
import
dataset
if
ha
and
"virtual_ip"
in
os
.
environ
:
ip
=
os
.
environ
[
"virtual_ip"
]
controller1_ip
=
os
.
environ
[
'controller1_ip'
]
...
...
This diff is collapsed.
Click to expand it.
tests/api2/test_275_ldap.py
View file @
0c33dae1
import
os
import
sys
import
time
import
pytest
from
pytest_dependency
import
depends
# TODO: we alreay have an assets module in middlewared.test.integration
# so move this there to prevent the sys.path alteration nonsense.
# This has to be done because the local assets directory isn't in python
# PATH since these tests aren't installed as a python "package"
sys
.
path
.
append
(
os
.
getcwd
())
from
functions
import
(
GET
,
PUT
,
...
...
@@ -12,9 +19,9 @@ from functions import (
cmd_test
,
wait_on_job
)
from
middlewared.test.integration.assets.privilege
import
privilege
from
middlewared.test.integration.utils
import
call
,
client
from
assets.privilege
import
privilege
from
assets.REST.directory_services
import
ldap
from
middlewared.test.integration.utils
import
call
,
client
from
auto_config
import
pool_name
,
ip
,
user
,
password
,
dev_test
# comment pytestmark for development testing with --dev-test
pytestmark
=
pytest
.
mark
.
skipif
(
dev_test
,
reason
=
'Skipping for test development testing'
)
...
...
This diff is collapsed.
Click to expand it.
tests/api2/test_278_freeipa.py
View file @
0c33dae1
import
os
import
sys
import
pytest
from
pytest_dependency
import
depends
# TODO: we alreay have an assets module in middlewared.test.integration
# so move this there to prevent the sys.path alteration nonsense.
# This has to be done because the local assets directory isn't in python
# PATH since these tests aren't installed as a python "package"
sys
.
path
.
append
(
os
.
getcwd
())
from
functions
import
GET
,
POST
from
assets.REST.directory_services
import
ldap
from
auto_config
import
dev_test
...
...
This diff is collapsed.
Click to expand it.
tests/api2/test_340_pool_dataset.py
View file @
0c33dae1
import
os
import
sys
import
pytest
from
pytest_dependency
import
depends
# TODO: we alreay have an assets module in middlewared.test.integration
# so move this there to prevent the sys.path alteration nonsense.
# This has to be done because the local assets directory isn't in python
# PATH since these tests aren't installed as a python "package"
sys
.
path
.
append
(
os
.
getcwd
())
from
assets.REST.pool
import
dataset
as
create_dataset
from
functions
import
DELETE
,
GET
,
POST
,
PUT
,
SSH_TEST
,
wait_on_job
,
make_ws_request
from
auto_config
import
dev_test
,
ip
,
pool_name
,
user
,
password
# comment pytestmark for development testing with --dev-test
pytestmark
=
pytest
.
mark
.
skipif
(
dev_test
,
reason
=
'Skipping for test development testing'
)
dataset
=
f
'
{
pool_name
}
/dataset1'
dataset_url
=
dataset
.
replace
(
'/'
,
'%2F'
)
zvol
=
f
'
{
pool_name
}
/zvol1'
...
...
This diff is collapsed.
Click to expand it.
tests/api2/test_425_smb_protocol.py
View file @
0c33dae1
import
os
import
sys
import
enum
from
time
import
sleep
from
base64
import
b64decode
,
b64encode
...
...
@@ -6,16 +7,19 @@ from base64 import b64decode, b64encode
import
pytest
from
pytest_dependency
import
depends
# TODO: we alreay have an assets module in middlewared.test.integration
# so move this there to prevent the sys.path alteration nonsense.
# This has to be done because the local assets directory isn't in python
# PATH since these tests aren't installed as a python "package"
sys
.
path
.
append
(
os
.
getcwd
())
from
auto_config
import
ip
,
pool_name
,
dev_test
,
user
,
password
from
assets.REST.pool
import
dataset
as
create_dataset
from
functions
import
PUT
,
POST
,
GET
,
DELETE
,
SSH_TEST
from
protocols
import
SMB
,
smb_connection
,
smb_share
from
samba
import
ntstatus
from
samba
import
NTSTATUSError
from
samba
import
ntstatus
,
NTSTATUSError
# comment pytestmark for development testing with --dev-test
pytestmark
=
pytest
.
mark
.
skipif
(
dev_test
,
reason
=
'Skipping for test development testing'
)
dataset
=
f
"
{
pool_name
}
/smb-proto"
dataset_url
=
dataset
.
replace
(
'/'
,
'%2F'
)
SMB_NAME
=
"SMBPROTO"
...
...
This diff is collapsed.
Click to expand it.
tests/api2/test_430_smb_sharesec.py
View file @
0c33dae1
import
os
import
sys
import
pytest
from
pytest_dependency
import
depends
# TODO: we alreay have an assets module in middlewared.test.integration
# so move this there to prevent the sys.path alteration nonsense.
# This has to be done because the local assets directory isn't in python
# PATH since these tests aren't installed as a python "package"
sys
.
path
.
append
(
os
.
getcwd
())
from
assets.REST.pool
import
dataset
from
middlewared.test.integration.assets.smb
import
smb_share
from
functions
import
PUT
,
POST
,
SSH_TEST
from
functions
import
make_ws_request
,
wait_on_job
from
functions
import
PUT
,
POST
,
SSH_TEST
,
make_ws_request
,
wait_on_job
from
auto_config
import
pool_name
,
user
,
password
,
ip
,
dev_test
# comment pytestmark for development testing with --dev-test
pytestmark
=
pytest
.
mark
.
skipif
(
dev_test
,
reason
=
'Skipping for test development testing'
)
...
...
This diff is collapsed.
Click to expand it.
tests/api2/test_438_snapshots.py
View file @
0c33dae1
import
os
import
sys
import
pytest
# TODO: we alreay have an assets module in middlewared.test.integration
# so move this there to prevent the sys.path alteration nonsense.
# This has to be done because the local assets directory isn't in python
# PATH since these tests aren't installed as a python "package"
sys
.
path
.
append
(
os
.
getcwd
())
from
assets.REST.pool
import
dataset
from
assets.REST.snapshot
import
snapshot
from
auto_config
import
dev_test
,
pool_name
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment