Esempio n. 1
0
def _check_has_ansys():
    """Safely wraps check_valid_ansys

    Returns
    -------
    has_ansys : bool
        True when this local installation has ANSYS installed in a
        standard location.
    """
    from ansys.mapdl.core.launcher import check_valid_ansys
    try:
        return check_valid_ansys()
    except:
        return False
Esempio n. 2
0
"""Test PyMAPDL license.py module."""

import time
import types
import os
import pytest

from ansys.mapdl.core import licensing, errors, launch_mapdl
from ansys.mapdl.core.misc import threaded
from ansys.mapdl.core.launcher import get_start_instance, check_valid_ansys

skip_launch_mapdl = pytest.mark.skipif(
    not get_start_instance() and check_valid_ansys(),
    reason="Must be able to launch MAPDL locally")

FAKE_CHECKOUT_SUCCESS = """
2021/09/17 14:08:19    INFO                Starting Licensing Client Proxy server.
2021/09/17 14:08:19    INFO                /usr/ansys_inc/v212/licensingclient/linx64/ansyscl -acl 3423788.77064 -nodaemon -log /home/USER/.ansys/ansyscl.HOST.3423788.77064.log
2021/09/17 14:08:19    INFO                Started ANSYSLI server.
2021/09/17 14:08:21    CLIENT_CONNECT                                                                                           1/1/1/1   3423788:FEAT_ANSYS:USER@HOST:linx64                         25:127.0.1.1
2021/09/17 14:08:21    NEW_CONNECTION      Connected to Licensing Client Proxy server: [email protected].
2021/09/17 14:08:21    CHECKOUT            ansys                           21.2 (2021.0512)            1/1/1/30                 1/1/1/1   3423788:FEAT_ANSYS:USER@HOST:linx64                         25:127.0.1.1
2021/09/17 14:08:21    CHECKOUT            FEAT_ANSYS                      21.2 (2021.0512)             1/1/1/1                 1/1/1/1   3423788:FEAT_ANSYS:USER@HOST:linx64                         25:127.0.1.1
2021/09/17 14:08:21    SPLIT_CHECKOUT      HPC_PARALLEL                    21.2 (2021.0512)             2/2/2/4                 1/1/1/1   3423788:FEAT_ANSYS:USER@HOST:linx64                         25:127.0.1.1
2021/09/17 14:08:21    CHECKOUT            HPC_PARALLEL                    21.2 (2021.0512)             2/2/2/4                 1/1/1/1   3423788:FEAT_ANSYS:USER@HOST:linx64                         25:127.0.1.1
"""

# TEST-NET-3 (not quite a black hole, but set aside by RFC 5737)
test_net_3 = "203.0.113.0"

PATH = os.path.dirname(os.path.abspath(__file__))