Skip to content

Commit a027742

Browse files
committed
fix(ci): Change the image to scan to quay.io/sysdig/agent
1 parent f735af7 commit a027742

File tree

3 files changed

+15
-20
lines changed

3 files changed

+15
-20
lines changed

specs/secure/activitylog_v1_spec.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@
4848
ok, res = self.client.list_events(data_sources=[ActivityAuditDataSource.KUBE_EXEC])
4949
expect((ok, res)).to(be_successful_api_call)
5050

51-
# FIXME: Dependiendo del entorno, puede que no existan KUBE_EXEC events, así que aqui necesitaría parar
52-
# este test ya que la lista devuelta, será vacía
53-
5451
expect(res).to(contain(have_keys(traceable=True)))
5552

5653
traceable_events = [event for event in res if event["traceable"]]

specs/secure/scanning/policy_evaluation_spec.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,50 +11,47 @@
1111
with before.all:
1212
self.client = SdScanningClient(sdc_url=os.getenv("SDC_SECURE_URL", "https://secure.sysdig.com"),
1313
token=os.getenv("SDC_SECURE_TOKEN"))
14+
self.image_name = "quay.io/sysdig/agent:latest"
1415

1516
with it("is able to retrieve the results for all the policies"):
16-
image_name = "alpine:latest"
17-
ok, res = self.client.get_image_scanning_results(image_name)
17+
ok, res = self.client.get_image_scanning_results(self.image_name)
1818

1919
expect((ok, res)).to(be_successful_api_call)
2020
expect(res).to(
2121
have_keys("image_digest", "image_id", "stop_results",
2222
total_warn=be_above_or_equal(0), total_stop=be_above_or_equal(0),
2323
last_evaluation=be_an(datetime),
24-
status="pass", image_tag="docker.io/alpine:latest",
24+
status="pass", image_tag=self.image_name,
2525
policy_id="*", policy_name="All policies",
2626
warn_results=not_(be_empty))
2727
)
2828

2929
with it("is able to retrieve the results for the default policy"):
30-
image_name = "alpine:latest"
3130
policy_id = "default"
32-
ok, res = self.client.get_image_scanning_results(image_name, policy_id)
31+
ok, res = self.client.get_image_scanning_results(self.image_name, policy_id)
3332

3433
expect((ok, res)).to(be_successful_api_call)
3534
expect(res).to(
3635
have_keys("image_digest", "image_id", "stop_results",
3736
total_warn=be_above_or_equal(0), total_stop=be_above_or_equal(0),
3837
last_evaluation=be_an(datetime),
39-
status="pass", image_tag="docker.io/alpine:latest",
38+
status="pass", image_tag=self.image_name,
4039
policy_id="default", policy_name="DefaultPolicy",
4140
warn_results=not_(be_empty))
4241
)
4342

4443
with context("but the image has not been scanned yet"):
4544
with it("returns an error saying that the image has not been found"):
46-
image_name = "unknown_image"
47-
ok, res = self.client.get_image_scanning_results(image_name)
45+
ok, res = self.client.get_image_scanning_results("unknown_image")
4846

4947
expect((ok, res)).to_not(be_successful_api_call)
5048
expect(res).to(equal("could not retrieve image digest for the given image name, "
5149
"ensure that the image has been scanned"))
5250

5351
with context("but the provided policy id does not exist"):
5452
with it("returns an error saying that the policy id is not found"):
55-
image_name = "alpine"
5653
policy_id = "unknown_policy_id"
57-
ok, res = self.client.get_image_scanning_results(image_name, policy_id)
54+
ok, res = self.client.get_image_scanning_results(self.image_name, policy_id)
5855

5956
expect((ok, res)).to_not(be_successful_api_call)
6057
expect(res).to(equal("the specified policy ID doesn't exist"))

specs/secure/scanning/query_image_content_spec.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,41 @@
1010
with before.each:
1111
self.client = SdScanningClient(sdc_url=os.getenv("SDC_SECURE_URL", "https://secure.sysdig.com"),
1212
token=os.getenv("SDC_SECURE_TOKEN"))
13+
self.image_to_scan = "quay.io/sysdig/agent:latest"
1314

1415
with it("is able to retrieve the OS contents"):
15-
ok, res = self.client.query_image_content("alpine:latest", "os")
16+
ok, res = self.client.query_image_content(self.image_to_scan, "os")
1617

1718
expect((ok, res)).to(be_successful_api_call)
1819
expect(res["content"]).to(contain(have_keys("license", "origin", "package", "size", "type", "version")))
1920
expect(res["content_type"]).to(equal("os"))
2021

2122
with it("is able to retrieve the npm contents"):
22-
ok, res = self.client.query_image_content("alpine:latest", "npm")
23+
ok, res = self.client.query_image_content(self.image_to_scan, "npm")
2324

2425
expect((ok, res)).to(be_successful_api_call)
2526
expect(res["content_type"]).to(equal("npm"))
2627

2728
with it("is able to retrieve the gem contents"):
28-
ok, res = self.client.query_image_content("alpine:latest", "gem")
29+
ok, res = self.client.query_image_content(self.image_to_scan, "gem")
2930

3031
expect((ok, res)).to(be_successful_api_call)
3132
expect(res["content_type"]).to(equal("gem"))
3233

3334
with it("is able to retrieve the python contents"):
34-
ok, res = self.client.query_image_content("alpine:latest", "python")
35+
ok, res = self.client.query_image_content(self.image_to_scan, "python")
3536

3637
expect((ok, res)).to(be_successful_api_call)
3738
expect(res["content_type"]).to(equal("python"))
3839

3940
with it("is able to retrieve the java contents"):
40-
ok, res = self.client.query_image_content("alpine:latest", "java")
41+
ok, res = self.client.query_image_content(self.image_to_scan, "java")
4142

4243
expect((ok, res)).to(be_successful_api_call)
4344
expect(res["content_type"]).to(equal("java"))
4445

4546
with it("is able to retrieve the files contents"):
46-
ok, res = self.client.query_image_content("alpine:latest", "files")
47+
ok, res = self.client.query_image_content(self.image_to_scan, "files")
4748

4849
expect((ok, res)).to(be_successful_api_call)
4950
expect(res["content"]).to(
@@ -52,7 +53,7 @@
5253

5354
with context("when the type is not in the supported list"):
5455
with it("returns an error indicating the type is incorrect"):
55-
ok, res = self.client.query_image_content("alpine:latest", "Unknown")
56+
ok, res = self.client.query_image_content(self.image_to_scan, "Unknown")
5657

5758
expect((ok, res)).not_to(be_successful_api_call)
5859
expect(res).to(equal(

0 commit comments

Comments
 (0)