Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: python windows dll pattern tests #4032

Open
terriko opened this issue Apr 15, 2024 · 4 comments
Open

test: python windows dll pattern tests #4032

terriko opened this issue Apr 15, 2024 · 4 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@terriko
Copy link
Contributor

terriko commented Apr 15, 2024

In #4023, @jananir640 has added a pattern to detect python3 DLLs for windows correctly.

It would be good to have a pair of tests using this new pattern:

  1. Add some mapping test data to https://github.com/intel/cve-bin-tool/blob/main/test/test_data/python.py that triggers this pattern
  2. Add a file test, potentially using https://s3.amazonaws.com/ddagent-windows-stable/datadog-agent-7-latest.amd64.msi which was the file that originally triggered the bug

This should be doable by a new user, so I'm flagging it as a good first issue. But now that we're not in the middle of gsoc applications (and thus trying to save good first issues for gsoc applicants), anyone should feel free to work on this.

@terriko terriko added the good first issue Good for newcomers label Apr 15, 2024
@ranjanmangla1
Copy link
Contributor

I am working on this. It'd be fun to work on this

@terriko
Copy link
Contributor Author

terriko commented May 6, 2024

@ranjanmangla1 have fun! Let us know if you get stuck anywhere.

@ranjanmangla1
Copy link
Contributor

@terriko sorry for the late response

the mapping test is working fine, package test/file test:

{
        "url": "https://s3.amazonaws.com/ddagent-windows-stable/",
        "package_name": "datadog-agent-7-latest.amd64.msi",
        "product": "python",
        "version": "3.11.8",
}

, is giving an error about python not being found

actually it is creating an empty tar file in condensed_downloads directory, i tried giving an already downloaded file in downloads dir. but still getting test case failed for this one

I manually verified the python version in the file using msiextract & got this:

agent 7.54.1
agent-dependencies                            7.54.1              
datadog-agent                                 7.54.1              
datadog-agent-dependencies                    7.54.1              
datadog-agent-finalize                        1.0.0               
datadog-agent-integrations-py3                7.54.1                  
datadog-agent-integrations-py3-dependencies   7.54.1              
datadog-agent-prepare                         1.0.0               
datadog-cf-finalize                           1.0.0               
datadog-security-agent-policies               v0.54.1               
jmxfetch                                      0.49.1  
pip3                                          23.3.1   
python3                                       3.11.8  
   

what can be done to solve this issue?

@terriko
Copy link
Contributor Author

terriko commented Jul 16, 2024

Hmm, the condensed downloads code I don't think has been changed recently, but the fact that it's making an empty file is suspicious because that implies it's not extracting strings correctly. My first guess would be that it might be because our condensed download code doens't understand msi, but that's really a guess and could be completely off track.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants