Skip to content

Commit

Permalink
remove old registry scan tests
Browse files Browse the repository at this point in the history
Signed-off-by: Amir Malka <[email protected]>
  • Loading branch information
amirmalka committed Jan 8, 2025
1 parent 3f548a0 commit 8fe0be7
Show file tree
Hide file tree
Showing 16 changed files with 1 addition and 2,957 deletions.
5 changes: 1 addition & 4 deletions configurations/system/tests_cases/registry_tests.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import inspect
from os.path import join

from systest_utils.statics import DEFAULT_NOTIFICATIONS_PATHS, DEFAULT_NOTIFICATIONS_DEPLOYMENT_PATH, \
DEFAULT_REGISTRY_PATHS
from tests_scripts.users_notifications.alert_notifications import get_messages_from_teams_channel, \
enrich_teams_alert_channel, get_messages_from_slack_channel, enrich_slack_alert_channel
from systest_utils.statics import DEFAULT_REGISTRY_PATHS
from .structures import TestConfiguration

class RegistryTests(object):
Expand Down
104 changes: 0 additions & 104 deletions configurations/system/tests_cases/vuln_scan_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,84 +110,6 @@ def vuln_scan_cve_global_namespace_exceptions():
helm_kwargs={"triggerNewImageScan": True},
)

@staticmethod
def vuln_scan_trigger_scan_public_registry():
from tests_scripts.helm.vuln_scan import VulnerabilityScanningRegistry
from systest_utils.statics import DEFAULT_DEPLOYMENT_PATH, DEFAULT_SERVICE_PATH
from os.path import join
return TestConfiguration(
name=inspect.currentframe().f_code.co_name,
test_obj=VulnerabilityScanningRegistry,
deployment=join(DEFAULT_DEPLOYMENT_PATH, "public-registry.yaml"),
service=join(DEFAULT_SERVICE_PATH, "public-registry.yaml"),
properties={'http': True}, # https://hub.armosec.io/docs/registry-vulnerability-scan
registry='local', # either local or specify the registry itself
configmap_data=None, # https://hub.armosec.io/docs/registry-vulnerability-scan
expected_results="nginx-new-image.json",
expected_payloads={"image": "nginx:test"},
is_https=False
)

@staticmethod
def vuln_scan_trigger_scan_public_registry_excluded():
from tests_scripts.helm.vuln_scan import VulnerabilityScanningRegistry
from systest_utils.statics import DEFAULT_DEPLOYMENT_PATH, DEFAULT_SERVICE_PATH
from os.path import join
return TestConfiguration(
name=inspect.currentframe().f_code.co_name,
test_obj=VulnerabilityScanningRegistry,

# This test is forced to use version 1.24.2 of the helm chart since this is the last version which supports the old registry scan API
# Please remove this test once the BE will stop supporting this functionality')
helm_branch="kubescape-operator-1.24.2",
deployment=join(DEFAULT_DEPLOYMENT_PATH, "public-registry.yaml"),
service=join(DEFAULT_SERVICE_PATH, "public-registry.yaml"),
properties={'http': True}, # https://hub.armosec.io/docs/registry-vulnerability-scan
registry='local', # either local or specify the registry itself
configmap_data={
"depth": 2,
"exclude": ["nginx"]
}, # https://hub.armosec.io/docs/registry-vulnerability-scan
expected_results="nginx-new-image.json",
expected_payloads={"image": "nginx:test"}
)

@staticmethod
def vuln_scan_trigger_scan_private_quay_registry():
from systest_utils.statics import DEFAULT_DEPLOYMENT_PATH, DEFAULT_SERVICE_PATH
from os.path import join
return TestConfiguration(
name=inspect.currentframe().f_code.co_name,
test_obj=VulnerabilityScanningRegistry,
deployment=join(DEFAULT_DEPLOYMENT_PATH, "public-registry.yaml"),
service=join(DEFAULT_SERVICE_PATH, "public-registry.yaml"),
# https://hub.armosec.io/docs/registry-vulnerability-scan
properties=None, # https://hub.armosec.io/docs/registry-vulnerability-scan
registry='quay.io/armosec', # either local or specify the registry itself
configmap_data=None, # https://hub.armosec.io/docs/registry-vulnerability-scan
expected_results="nginx-new-image.json",
expected_payloads={"image": "system-test-nginx:latest"}

)

@staticmethod
def vuln_scan_trigger_scan_registry_by_backend():
from tests_scripts.helm.vuln_scan import VulnerabilityScanningRegistryBackendTrigger
from systest_utils.statics import DEFAULT_DEPLOYMENT_PATH, DEFAULT_SERVICE_PATH
from os.path import join
return TestConfiguration(
name=inspect.currentframe().f_code.co_name,
test_obj=VulnerabilityScanningRegistryBackendTrigger,
deployment=join(DEFAULT_DEPLOYMENT_PATH, "public-registry.yaml"),
service=join(DEFAULT_SERVICE_PATH, "public-registry.yaml"),
properties={'http': True}, # https://hub.armosec.io/docs/registry-vulnerability-scan
registry='local', # either local or specify the registry itself
configmap_data=None, # https://hub.armosec.io/docs/registry-vulnerability-scan
expected_results="nginx-new-image.json",
expected_payloads={"image": "nginx:test"},
expected_layers="layers.json"
)

@staticmethod
def vuln_scan_triggering_with_cron_job():
from tests_scripts.helm.vuln_scan import VulnerabilityScanningTriggeringWithCronJob
Expand All @@ -203,29 +125,3 @@ def vuln_scan_triggering_with_cron_job():
schedule_time="1 2 3 4 5",
updating_schedule_time="1 * * * *"
)

@staticmethod
def registry_scanning_triggering_with_cron_job():
from tests_scripts.helm.vuln_scan import RegistryScanningTriggeringWithCronJob
from systest_utils.statics import DEFAULT_DEPLOYMENT_PATH, DEFAULT_SERVICE_PATH, DEFAULT_CONFIGMAP_PATH
from os.path import join
return TestConfiguration(
name=inspect.currentframe().f_code.co_name,
test_obj=RegistryScanningTriggeringWithCronJob,

# This test is forced to use version 1.24.2 of the helm chart since this is the last version which supports the old registry scan API
# Please remove this test once the BE will stop supporting this functionality')
helm_branch="kubescape-operator-1.24.2",
deployment=join(DEFAULT_DEPLOYMENT_PATH, "public-registry.yaml"),
service=join(DEFAULT_SERVICE_PATH, "public-registry.yaml"),
properties={'http': True}, # https://hub.armosec.io/docs/registry-vulnerability-scan
registry='local', # either local or specify the registry itself
configmap_data=None, # https://hub.armosec.io/docs/registry-vulnerability-scan
expected_results="nginx-new-image.json",
expected_payloads={"image": "nginx:test"},
schedule_time="1 2 3 4 5",
updating_schedule_time="2 2 2 2 2",
expected_layers="layers.json",
depth=3,
)

Loading

0 comments on commit 8fe0be7

Please sign in to comment.