Skip to content

Commit

Permalink
Add 1592 to ingestion process
Browse files Browse the repository at this point in the history
  • Loading branch information
fwilhe authored Aug 27, 2024
1 parent 7ca2ff5 commit 597f9fb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 28 deletions.
12 changes: 11 additions & 1 deletion ingest-postgres.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ curl -s https://packages.gardenlinux.io/gardenlinux/dists/1443.5/main/binary-amd
curl -s https://packages.gardenlinux.io/gardenlinux/dists/1443.7/main/binary-amd64/Packages.gz > gardenlinux-packages/1443.7.gz
curl -s https://packages.gardenlinux.io/gardenlinux/dists/1443.8/main/binary-amd64/Packages.gz > gardenlinux-packages/1443.8.gz
curl -s https://packages.gardenlinux.io/gardenlinux/dists/1443.9/main/binary-amd64/Packages.gz > gardenlinux-packages/1443.9.gz
curl -s https://packages.gardenlinux.io/gardenlinux/dists/1443.10/main/binary-amd64/Packages.gz > gardenlinux-packages/1443.10.gz
curl -s https://packages.gardenlinux.io/gardenlinux/dists/1592.0/main/binary-amd64/Packages.gz > gardenlinux-packages/1592.0.gz
curl -s https://packages.gardenlinux.io/gardenlinux/dists/1592.1/main/binary-amd64/Packages.gz > gardenlinux-packages/1592.1.gz
curl -s https://packages.gardenlinux.io/gardenlinux/dists/today/main/binary-amd64/Packages.gz > gardenlinux-packages/today.gz
gunzip gardenlinux-packages/1443*.gz
gunzip gardenlinux-packages/1592*.gz
gunzip gardenlinux-packages/today.gz

echo "Run data ingestion (ingest-debsrc - debian trixie)"
Expand All @@ -56,7 +60,13 @@ glvd-data ingest-debsrc gardenlinux 1443.7 ./gardenlinux-packages/1443.7
echo "Run data ingestion (ingest-debsrc - gardenlinux 1443.8)"
glvd-data ingest-debsrc gardenlinux 1443.8 ./gardenlinux-packages/1443.8
echo "Run data ingestion (ingest-debsrc - gardenlinux 1443.9)"
glvd-data ingest-debsrc gardenlinux 1443 ./gardenlinux-packages/1443.9
glvd-data ingest-debsrc gardenlinux 1443.9 ./gardenlinux-packages/1443.9
echo "Run data ingestion (ingest-debsrc - gardenlinux 1443.10)"
glvd-data ingest-debsrc gardenlinux 1443 ./gardenlinux-packages/1443.10
echo "Run data ingestion (ingest-debsrc - gardenlinux 1592.0)"
glvd-data ingest-debsrc gardenlinux 1592.0 ./gardenlinux-packages/1592.0
echo "Run data ingestion (ingest-debsrc - gardenlinux 1592.1)"
glvd-data ingest-debsrc gardenlinux 1592 ./gardenlinux-packages/1592.1
echo "Run data ingestion (nvd)"
glvd-data ingest-nvd
echo "Run data combination (combine-deb)"
Expand Down
5 changes: 4 additions & 1 deletion src/glvd/data/dist_cpe.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,11 @@ def __call__(self, codename: str) -> DistCpe:
'1443.5': '1443.5',
'1443.7': '1443.7',
'1443.8': '1443.8',
'1443.9': '1443.9',
# latest patch release gets codename without the dot -> for cases where you want to follow the latest
'1443': '1443.9',
'1443': '1443.10',
'1592.0': '1592.0',
'1592': '1592.1',
'today': 'today',
'': '',
}[codename]
Expand Down
26 changes: 0 additions & 26 deletions tests/data/test_dist_cpe.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,29 +45,3 @@ def test_invalid(self) -> None:

with pytest.raises(KeyError):
m('invalid')


class TestDistCpeMapperGardenlinux:
@pytest.mark.parametrize(
'codename,version',
[
('1443.0', '1443.0'),
('1443.1', '1443.1'),
('1443.2', '1443.2'),
('1443.3', '1443.3'),
('1443.5', '1443.5'),
('1443.7', '1443.7'),
('1443.8', '1443.8'),
('1443', '1443.9'),
('today', 'today'),
('', ''),
],
)
def test_valid(self, codename: str, version: str) -> None:
m = DistCpeMapper.new('gardenlinux')
c = m(codename)

assert c.cpe_vendor == 'sap'
assert c.cpe_product == 'gardenlinux'
assert c.cpe_version == version
assert c.deb_codename == codename

0 comments on commit 597f9fb

Please sign in to comment.