Skip to content

Commit

Permalink
Test rpm metadata changes
Browse files Browse the repository at this point in the history
Signed-off-by: Divya Madala <[email protected]>
  • Loading branch information
Divyaasm committed Sep 7, 2024
1 parent 09dcd76 commit 54c6d58
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/validation_workflow/rpm/validation_rpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,17 @@ def validate_metadata(self, product_type: str) -> None:

def validate_signature(self) -> None:
(_, stdout, _) = execute(f'rpm -K -v {os.path.join(self.tmp_dir.path, self.filename)}', ".")
logging.info(stdout)
key_list = ["Header V4 RSA/SHA512 Signature, key ID 9310d3fc", "Header SHA256 digest", "Header SHA1 digest", "Payload SHA256 digest", "V4 RSA/SHA512 Signature, key ID 9310d3fc", "MD5 digest"]
present_key = []
for line in stdout.split('\n'):
key = line.split(':')[0].strip()
if "OK" in line.split(':', 1)[1].strip():
print(key)
# #if (key == os.path.join(self.tmp_dir.path, self.filename)):
# # continue
if "OK" == line.split(':', 1)[1].strip():
logging.info(f"{key} is validated as: {line}")
present_key.append(key)
present_key.append(key)
logging.info("Validation of all key digests starts: ")
for digest in key_list:
if digest in present_key:
Expand Down

0 comments on commit 54c6d58

Please sign in to comment.