Commit 0c33dae1 authored by Caleb's avatar Caleb
Browse files

sigh add back sys.path to some modules

parent 22e5c624
Showing with 124 additions and 29 deletions
+124 -29
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
......
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:
......
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:
......
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:
......
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
......
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:
......
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
......
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')
......
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']
......
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')
......
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
......
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'
......
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"
......
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')
......
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment