Exemple #1
0
def test_get_sas_components(report: ViyaDeploymentReport) -> None:
    """
    This test verifies that the correct number of SAS components are returned in a completed report.

    :param report: The populated ViyaDeploymentReport returned by the report() fixture.
    """
    # get SAS components information
    sas_components: Dict = report.get_sas_components()

    # check for expected attributes
    assert len(sas_components) == 4
Exemple #2
0
def test_get_sas_components_statefulset_owned(
        report: ViyaDeploymentReport) -> None:
    """
    This test verifies that the component owned by a StatefulSet object is correctly collected in a completed report.
    Test the collection of: (1) Pod, (2) Service, (3) StatefulSet

    :param report: The populated ViyaDeploymentReport returned by the report() fixture.
    """
    # get SAS components information
    sas_components: Dict = report.get_sas_components()

    # check for expected attributes
    assert KubectlTest.Values.COMPONENT_SAS_CACHE_SERVER_NAME in sas_components
    assert KubernetesResource.Kinds.POD in sas_components[
        KubectlTest.Values.COMPONENT_SAS_CACHE_SERVER_NAME]
    assert KubernetesResource.Kinds.SERVICE in \
        sas_components[KubectlTest.Values.COMPONENT_SAS_CACHE_SERVER_NAME]
    assert KubernetesResource.Kinds.STATEFUL_SET in \
        sas_components[KubectlTest.Values.COMPONENT_SAS_CACHE_SERVER_NAME]
Exemple #3
0
def test_get_sas_components_cronjob_owned(
        report: ViyaDeploymentReport) -> None:
    """
    This test verifies that the component owned by a CronJob object is correctly collected in a completed report.
    Tests the collection of: (1) CronJob, (2) Job, (3) Pod

    :param report: The populated ViyaDeploymentReport returned by the report() fixture.
    """
    # get SAS components information
    sas_components: Dict = report.get_sas_components()

    # check for expected attributes
    assert KubectlTest.Values.COMPONENT_SAS_SCHEDULED_BACKUP_JOB_NAME in sas_components
    assert KubernetesResource.Kinds.CRON_JOB in \
        sas_components[KubectlTest.Values.COMPONENT_SAS_SCHEDULED_BACKUP_JOB_NAME]
    assert KubernetesResource.Kinds.JOB in sas_components[
        KubectlTest.Values.COMPONENT_SAS_SCHEDULED_BACKUP_JOB_NAME]
    assert KubernetesResource.Kinds.POD in sas_components[
        KubectlTest.Values.COMPONENT_SAS_SCHEDULED_BACKUP_JOB_NAME]
Exemple #4
0
def test_get_sas_components_deployment_owned(
        report: ViyaDeploymentReport) -> None:
    """
    This test verifies that the component owned by a Deployment object is correctly collected in a completed report.
    Tests the collection of: (1) Deployment, (2) Ingress, (3) Pod, (4) ReplicaSet, (5) Service

    :param report: The populated ViyaDeploymentReport returned by the report() fixture.
    """
    # get SAS components information
    sas_components: Dict = report.get_sas_components()

    # check for expected attributes
    assert KubectlTest.Values.COMPONENT_SAS_ANNOTATIONS_NAME in sas_components
    assert KubernetesResource.Kinds.DEPLOYMENT in sas_components[
        KubectlTest.Values.COMPONENT_SAS_ANNOTATIONS_NAME]
    assert KubernetesResource.Kinds.INGRESS in sas_components[
        KubectlTest.Values.COMPONENT_SAS_ANNOTATIONS_NAME]
    assert KubernetesResource.Kinds.POD in sas_components[
        KubectlTest.Values.COMPONENT_SAS_ANNOTATIONS_NAME]
    assert KubernetesResource.Kinds.REPLICA_SET in sas_components[
        KubectlTest.Values.COMPONENT_SAS_ANNOTATIONS_NAME]
    assert KubernetesResource.Kinds.SERVICE in sas_components[
        KubectlTest.Values.COMPONENT_SAS_ANNOTATIONS_NAME]