Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

Commit

Permalink
Added functional tests for verifying image content
Browse files Browse the repository at this point in the history
Signed-off-by: Zane Burstein <zane.burstein@anchore.com>
  • Loading branch information
zburstein committed Oct 4, 2021
1 parent b52b2aa commit 1801334
Show file tree
Hide file tree
Showing 23 changed files with 11,257 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/functional/services/api/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,31 @@ def _add_image_for_analysis(tag):
return http_post(["images"], {"tag": tag}, config=request.param)

return _add_image_for_analysis


@pytest.fixture(scope="class")
def add_image_with_teardown(request):
def _add_image_wit_teardown(tag):
add_response = http_post(["images"], {"tag": tag}, config=get_api_conf)
if add_response.code != 200:
raise RequestFailedError(
add_response.url, add_response.code, add_response.body
)

image_id = get_image_id(add_response)

def _delete_image():
remove_resp = http_del(
["images", "by_id", image_id],
query={"force": True},
config=get_api_conf,
)
if remove_resp.code != 200:
raise RequestFailedError(
remove_resp.url, remove_resp.code, remove_resp.body
)

request.addfinalizer(_delete_image)
return add_response

return _add_image_wit_teardown
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"content": [
{
"cpes": [
"cpe:2.3:a:*:ftpd:0.2.1:*:*:*:*:*:*:*",
"cpe:2.3:a:ftpd:ftpd:0.2.1:*:*:*:*:*:*:*",
"cpe:2.3:a:ruby-lang:ftpd:0.2.1:*:*:*:*:*:*:*",
"cpe:2.3:a:ruby:ftpd:0.2.1:*:*:*:*:*:*:*",
"cpe:2.3:a:ruby_lang:ftpd:0.2.1:*:*:*:*:*:*:*",
"cpe:2.3:a:wayne-conrad:ftpd:0.2.1:*:*:*:*:*:*:*",
"cpe:2.3:a:wayne_conrad:ftpd:0.2.1:*:*:*:*:*:*:*"
],
"license": "MIT",
"licenses": [
"MIT"
],
"location": "/var/lib/gems/2.5.0/specifications/ftpd-0.2.1.gemspec",
"origin": "Wayne Conrad",
"package": "ftpd",
"type": "GEM",
"version": "0.2.1"
},
{
"cpes": [
"cpe:2.3:a:*:memoizer:1.0.3:*:*:*:*:*:*:*",
"cpe:2.3:a:barun-singh:memoizer:1.0.3:*:*:*:*:*:*:*",
"cpe:2.3:a:barun_singh:memoizer:1.0.3:*:*:*:*:*:*:*",
"cpe:2.3:a:memoizer:memoizer:1.0.3:*:*:*:*:*:*:*",
"cpe:2.3:a:ruby-lang:memoizer:1.0.3:*:*:*:*:*:*:*",
"cpe:2.3:a:ruby:memoizer:1.0.3:*:*:*:*:*:*:*",
"cpe:2.3:a:ruby_lang:memoizer:1.0.3:*:*:*:*:*:*:*"
],
"license": "MIT",
"licenses": [
"MIT"
],
"location": "/var/lib/gems/2.5.0/specifications/memoizer-1.0.3.gemspec",
"origin": "Barun Singh",
"package": "memoizer",
"type": "GEM",
"version": "1.0.3"
}
],
"content_type": "gem",
"imageDigest": "sha256:406413437f26223183d133ccc7186f24c827729e1b21adc7330dd43fcdc030b3"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"content": [
{
"cpes": [
"cpe:2.3:a:*:ftpd:0.2.1:*:*:*:*:*:*:*",
"cpe:2.3:a:ftpd:ftpd:0.2.1:*:*:*:*:*:*:*",
"cpe:2.3:a:ruby-lang:ftpd:0.2.1:*:*:*:*:*:*:*",
"cpe:2.3:a:ruby:ftpd:0.2.1:*:*:*:*:*:*:*",
"cpe:2.3:a:ruby_lang:ftpd:0.2.1:*:*:*:*:*:*:*",
"cpe:2.3:a:wayne-conrad:ftpd:0.2.1:*:*:*:*:*:*:*",
"cpe:2.3:a:wayne_conrad:ftpd:0.2.1:*:*:*:*:*:*:*"
],
"license": "MIT",
"licenses": [
"MIT"
],
"location": "/usr/lib/ruby/gems/2.7.0/specifications/ftpd-0.2.1.gemspec",
"origin": "Wayne Conrad",
"package": "ftpd",
"type": "GEM",
"version": "0.2.1"
},
{
"cpes": [
"cpe:2.3:a:*:memoizer:1.0.3:*:*:*:*:*:*:*",
"cpe:2.3:a:barun-singh:memoizer:1.0.3:*:*:*:*:*:*:*",
"cpe:2.3:a:barun_singh:memoizer:1.0.3:*:*:*:*:*:*:*",
"cpe:2.3:a:memoizer:memoizer:1.0.3:*:*:*:*:*:*:*",
"cpe:2.3:a:ruby-lang:memoizer:1.0.3:*:*:*:*:*:*:*",
"cpe:2.3:a:ruby:memoizer:1.0.3:*:*:*:*:*:*:*",
"cpe:2.3:a:ruby_lang:memoizer:1.0.3:*:*:*:*:*:*:*"
],
"license": "MIT",
"licenses": [
"MIT"
],
"location": "/usr/lib/ruby/gems/2.7.0/specifications/memoizer-1.0.3.gemspec",
"origin": "Barun Singh",
"package": "memoizer",
"type": "GEM",
"version": "1.0.3"
}
],
"content_type": "gem",
"imageDigest": "sha256:80a31c3ce2e99c3691c27ac3b1753163214494e9b2ca07bfdccf29a5cca2bfbe"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"content": [
{
"cpes": [
"cpe:2.3:a:*:figaro:1.2.0:*:*:*:*:*:*:*",
"cpe:2.3:a:figaro:figaro:1.2.0:*:*:*:*:*:*:*",
"cpe:2.3:a:ruby-lang:figaro:1.2.0:*:*:*:*:*:*:*",
"cpe:2.3:a:ruby:figaro:1.2.0:*:*:*:*:*:*:*",
"cpe:2.3:a:ruby_lang:figaro:1.2.0:*:*:*:*:*:*:*",
"cpe:2.3:a:steve-richert:figaro:1.2.0:*:*:*:*:*:*:*",
"cpe:2.3:a:steve_richert:figaro:1.2.0:*:*:*:*:*:*:*"
],
"license": "MIT",
"licenses": [
"MIT"
],
"location": "/var/lib/gems/2.7.0/specifications/figaro-1.2.0.gemspec",
"origin": "Steve Richert",
"package": "figaro",
"type": "GEM",
"version": "1.2.0"
},
{
"cpes": [
"cpe:2.3:a:*:thor:1.1.0:*:*:*:*:*:*:*",
"cpe:2.3:a:jos\u00e9-valim:thor:1.1.0:*:*:*:*:*:*:*",
"cpe:2.3:a:jos\u00e9_valim:thor:1.1.0:*:*:*:*:*:*:*",
"cpe:2.3:a:ruby-lang:thor:1.1.0:*:*:*:*:*:*:*",
"cpe:2.3:a:ruby:thor:1.1.0:*:*:*:*:*:*:*",
"cpe:2.3:a:ruby_lang:thor:1.1.0:*:*:*:*:*:*:*",
"cpe:2.3:a:thor:thor:1.1.0:*:*:*:*:*:*:*",
"cpe:2.3:a:yehuda-katz:thor:1.1.0:*:*:*:*:*:*:*",
"cpe:2.3:a:yehuda_katz:thor:1.1.0:*:*:*:*:*:*:*"
],
"license": "MIT",
"licenses": [
"MIT"
],
"location": "/var/lib/gems/2.7.0/specifications/thor-1.1.0.gemspec",
"origin": "Yehuda Katz,Jos\u00e9 Valim",
"package": "thor",
"type": "GEM",
"version": "1.1.0"
}
],
"content_type": "gem",
"imageDigest": "sha256:ee7e86bed95c7d2eb2f106f7706d57cdeb1909a20f9f3f17cba361f778df79e4"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"content": [
{
"cpes": [
"cpe:2.3:a:*:ftpd:0.2.1:*:*:*:*:*:*:*",
"cpe:2.3:a:ftpd:ftpd:0.2.1:*:*:*:*:*:*:*",
"cpe:2.3:a:ruby-lang:ftpd:0.2.1:*:*:*:*:*:*:*",
"cpe:2.3:a:ruby:ftpd:0.2.1:*:*:*:*:*:*:*",
"cpe:2.3:a:ruby_lang:ftpd:0.2.1:*:*:*:*:*:*:*",
"cpe:2.3:a:wayne-conrad:ftpd:0.2.1:*:*:*:*:*:*:*",
"cpe:2.3:a:wayne_conrad:ftpd:0.2.1:*:*:*:*:*:*:*"
],
"license": "MIT",
"licenses": [
"MIT"
],
"location": "/usr/local/share/gems/specifications/ftpd-0.2.1.gemspec",
"origin": "Wayne Conrad",
"package": "ftpd",
"type": "GEM",
"version": "0.2.1"
},
{
"cpes": [
"cpe:2.3:a:*:memoizer:1.0.3:*:*:*:*:*:*:*",
"cpe:2.3:a:barun-singh:memoizer:1.0.3:*:*:*:*:*:*:*",
"cpe:2.3:a:barun_singh:memoizer:1.0.3:*:*:*:*:*:*:*",
"cpe:2.3:a:memoizer:memoizer:1.0.3:*:*:*:*:*:*:*",
"cpe:2.3:a:ruby-lang:memoizer:1.0.3:*:*:*:*:*:*:*",
"cpe:2.3:a:ruby:memoizer:1.0.3:*:*:*:*:*:*:*",
"cpe:2.3:a:ruby_lang:memoizer:1.0.3:*:*:*:*:*:*:*"
],
"license": "MIT",
"licenses": [
"MIT"
],
"location": "/usr/local/share/gems/specifications/memoizer-1.0.3.gemspec",
"origin": "Barun Singh",
"package": "memoizer",
"type": "GEM",
"version": "1.0.3"
}
],
"content_type": "gem",
"imageDigest": "sha256:fe3ca35038008b0eac0fa4e686bd072c9430000ab7d7853001bde5f5b8ccf60c"
}
Loading

0 comments on commit 1801334

Please sign in to comment.