-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tweak tests and add local windows tests
Windows tests dont work in Github actions because of localhost weird binding issues, but work fine in the docker image
- Loading branch information
1 parent
7491fd6
commit 3b1c50f
Showing
7 changed files
with
97 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM punksecurity/smbeagle | ||
RUN apt update && apt install python3 python3-pip -y | ||
RUN pip install impacket pytest | ||
RUN mkdir /empty_dir | ||
WORKDIR /tests/ | ||
COPY tests/* . | ||
ENTRYPOINT [ "" ] | ||
ENV ROOTDIR "/" | ||
CMD pytest -v -k 'not on_windows' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM mcr.microsoft.com/windows:20H2 | ||
ENV PYTHON_VERSION 3.10.5 | ||
ENV PYTHON_GET_PIP_URL https://bootstrap.pypa.io/get-pip.py | ||
|
||
COPY windows_scripts/* / | ||
RUN "powershell -noprofile -executionpolicy bypass -file .\install_python.ps1" | ||
|
||
RUN "pip install impacket pytest" | ||
|
||
ENV ROOTDIR "C:\\" | ||
WORKDIR "C:\\" | ||
RUN mkdir empty_dir tests | ||
COPY tests tests | ||
COPY x64 "C:\\windows\\system32\\." | ||
WORKDIR tests | ||
CMD pytest -v -k "not on_linux" | ||
|
||
# Cant test native auth as windows auth broken in containers... tried this hacky fix but no good | ||
#RUN net user /add test | ||
#RUN net localgroup administrators test /add | ||
#USER test | ||
#ENV NATIVE_AUTH=1 | ||
#RUN net user test goose; pytest -k test_fifty_files_in_the_root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
$url = ('https://www.python.org/ftp/python/{0}/python-{0}-amd64.exe' -f $env:PYTHON_VERSION) | ||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | ||
Invoke-WebRequest -Uri $url -OutFile 'python.exe'; | ||
# https://docs.python.org/3.7/using/windows.html#installing-without-ui | ||
Start-Process python.exe -Wait -ArgumentList @( | ||
'/quiet', | ||
'InstallAllUsers=1', | ||
'TargetDir=C:\Python', | ||
'PrependPath=1', | ||
'Shortcuts=0', | ||
'Include_doc=0', | ||
'Include_pip=1', | ||
'Include_test=0' | ||
); | ||
#the installer updated PATH, so we should refresh our local value | ||
Remove-Item python.exe -Force |