Skip to content

Commit

Permalink
Updated TlsTestGate (#11)
Browse files Browse the repository at this point in the history
* Update azure-pipelines.yml for Azure Pipelines

* Update azure-pipelines.yml for Azure Pipelines

* Update azure-pipelines.yml for Azure Pipelines

* Update azure-pipelines.yml for Azure Pipelines

* Update azure-pipelines.yml for Azure Pipelines

* Update azure-pipelines.yml for Azure Pipelines

* update tests

* initial devcontainer push

* tlstestgate works

* Update azure-pipelines.yml for Azure Pipelines

* fix windows unit test
  • Loading branch information
gattjoe committed Dec 7, 2021
1 parent 26bc5c6 commit 6657f01
Show file tree
Hide file tree
Showing 13 changed files with 6,355 additions and 458 deletions.
32 changes: 32 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.205.2/containers/docker-existing-dockerfile
{
"name": "Existing Dockerfile",

// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",

// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerFile": "../Dockerfile",

// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.defaultProfile.linux": "bash",
"terminal.integrated.profiles.linux": { "bash": { "path": "bash" } }
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": ["ms-python.vscode-pylance",
"visualstudioexptteam.vscodeintellicode",
"ms-azuretools.vscode-docker"],


// Uncomment the next line to run commands after the container is created - for example installing curl.
// "postCreateCommand": "apt-get update && apt-get install -y curl",

// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],

// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "tlstestgate"
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,11 @@
- Removed hardcoded python package configuration from tlstestgate.ts
- Added tox tests for Python 3.9
- Added pytest to validate junitparser functionality in scanner.py

# v1.4.0
- Created docker development environment in VS Code to work around M1 compatibility issues with SSLyze/NaSSL
- Updated to SSLyze 5.0.0
- Changed minimum Azure Pipeline Agent version to 2.144.0 in support of Node10
- Updated azure-pipelines-task-lib and azure-pipelines-tool-lib to latest version
- Formatted python files with black and linted with pylint
- Fixed test case that purposely failed resolving bbbbbbbbbbbbbbb.com because someone out there is now using it
46 changes: 46 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Usually you do not have to specify amd64
# but on a M1 you do if you want to use packages
# that are not optimized for arm64
FROM --platform=amd64 python:3.9.9-slim-bullseye

SHELL ["/bin/bash", "--login", "-c"]

ENV DEBIAN_FRONTEND noninteractive
ENV LANG C.UTF-8

RUN useradd -m tlstestgate

RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
netbase \
curl \
git \
bash-completion \
&& rm -rf /var/lib/apt/lists/*

RUN pip install --no-cache-dir --quiet --upgrade pip && \
pip install --no-cache-dir --quiet --upgrade setuptools && \
pip install --no-cache-dir --quiet pytest

USER tlstestgate
WORKDIR /home/tlstestgate
ENV NODE_VERSION 16.13.0

RUN curl --silent -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash

# nvm
RUN echo 'export NVM_DIR="$HOME/.nvm"' >> "$HOME/.bashrc"
RUN echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> "$HOME/.bashrc"
RUN echo '[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion" # This loads nvm bash_completion' >> "$HOME/.bashrc"

RUN nvm install $NODE_VERSION

ENV NODE_PATH $NVM_DIR/versions/node/v$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH

# Install TlsTestGate Packages
COPY --chown=tlstestgate:tlstestgate . /home/tlstestgate/TlsTestGate/
RUN cd TlsTestGate/buildAndReleaseTask && npm install
RUN cd TlsTestGate && pip install --no-cache-dir --quiet -r requirements.txt

CMD [ "bash" ]
5 changes: 3 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ stages:
command: 'custom'
workingDir: buildAndReleaseTask
customCommand: 'test'
verbose: false
verbose: true


- task: PublishTestResults@2
inputs:
Expand Down Expand Up @@ -123,4 +124,4 @@ stages:
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/ResultsFile.xml'
testRunTitle: 'Publish test results for getPythonPath.ts on MacOS'
testRunTitle: 'Publish test results for getPythonPath.ts on MacOS'
2 changes: 1 addition & 1 deletion buildAndReleaseTask/getpythonpath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export async function getPythonPath(): Promise<string> {

return pythonPath;

} catch (err) {
} catch (err: any) {

return err;
}
Expand Down
Loading

0 comments on commit 6657f01

Please sign in to comment.