-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from telamonian/smb_local_ci_tests
[WIP] add tests for local and smb flavors of PyFilesystemContentsManager
- Loading branch information
Showing
19 changed files
with
1,082 additions
and
270 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
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,65 @@ | ||
image: Visual Studio 2019 | ||
|
||
environment: | ||
PYTHON: "C:\\Python37" | ||
|
||
build: off | ||
|
||
services: | ||
- docker | ||
|
||
# mentioned in appveyor docs, doesn't seem to work | ||
# stack: docker, jdk 1.8, node 12, python 3.7 | ||
|
||
# runs before repo checkout | ||
init: | ||
# set the python version permanently (for debugging)... | ||
- ps: "[Environment]::SetEnvironmentVariable(\"Path\", \"$env:PYTHON;$env:PYTHON\\Scripts;$env:Path\", \"Machine\")" | ||
# ...and for this session | ||
- cmd: set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH% | ||
|
||
# install latest pip | ||
- python -m pip install --upgrade pip | ||
|
||
# set the node version | ||
- ps: Install-Product node 12 | ||
|
||
# install yarn globally | ||
- npm install -g yarn | ||
|
||
install: | ||
# set up a windows file share named "test" | ||
- ps: ci/enable_os_share_windows.ps1 | ||
- ps: ci/create_os_share_windows.ps1 | ||
|
||
# set up a local s3_proxy server | ||
- bash -c "ci/s3_local.sh" | ||
- ps: Start-Process -FilePath "java" -ArgumentList "-jar","s3proxy","--properties","s3proxy.conf" | ||
- bash -c "sleep 5" | ||
- curl http://127.0.0.1:9000/ | ||
|
||
# install python deps | ||
- pip install --upgrade --upgrade-strategy=eager -e .[dev] | ||
|
||
# install js deps | ||
- yarn | ||
|
||
# print all env vars | ||
- ps: gci env:* | sort-object name | ||
|
||
test_script: | ||
# lint the python code | ||
- python -m flake8 jupyterfs setup.py | ||
|
||
# lint the js code | ||
- yarn lint | ||
|
||
# test the python code | ||
- python -m pytest -v jupyterfs/tests --cov=jupyterfs --cov-branch | ||
|
||
# test the js code | ||
- yarn test | ||
|
||
on_failure: | ||
# enable remote login (via rdp) to windows ci vm on test failure | ||
- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) |
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,13 @@ | ||
#Requires -RunAsAdministrator | ||
|
||
$ErrorActionPreference = 'Stop' | ||
|
||
$smbuser_passwd = ConvertTo-SecureString "smbuser" -AsPlainText -Force | ||
New-LocalUser "smbuser" -Password $smbuser_passwd | ||
|
||
mkdir C:\shared | ||
|
||
New-SmbShare -Name "test" -Path "C:\shared" -FullAccess smbuser | ||
|
||
# display info on newly-created share | ||
Get-SmbShare |
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,24 @@ | ||
#Requires -RunAsAdministrator | ||
|
||
$ErrorActionPreference = 'Stop' | ||
|
||
# script to overcome all weird windows vm settings on azure | ||
|
||
# disable all password requirements (length, complexity, etc) | ||
# needed to allow for creation of new account smbuser:smbuser | ||
secedit /export /cfg c:\secpol.cfg | ||
(gc C:\secpol.cfg).replace("PasswordComplexity = 1", "PasswordComplexity = 0") | Out-File C:\secpol.cfg | ||
secedit /configure /db c:\windows\security\local.sdb /cfg c:\secpol.cfg /areas SECURITYPOLICY | ||
rm -force c:\secpol.cfg -confirm:$false | ||
|
||
# turn on file sharing | ||
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes | ||
|
||
# print out some info about local NETBIOS cache | ||
nbtstat -c | ||
|
||
# print out some info about local NETBIOS names | ||
nbtstat -n | ||
|
||
# print out some info about local NETBIOS resolutions | ||
nbtstat -r |
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,27 @@ | ||
#Requires -RunAsAdministrator | ||
|
||
# discover true names of errors: | ||
# $Error[0].Exception.GetType().FullName | ||
|
||
$ErrorActionPreference = 'Stop' | ||
|
||
try { | ||
Get-SmbShare -name "test" | ||
Remove-SmbShare -name "test" -force | ||
} | ||
catch [Microsoft.PowerShell.Cmdletization.Cim.CimJobException] { | ||
} | ||
|
||
try { | ||
ls C:\shared | ||
rm -r -fo C:\shared | ||
} | ||
catch [System.Management.Automation.ItemNotFoundException] { | ||
} | ||
|
||
try { | ||
Get-LocalUser -name "smbuser" | ||
Remove-LocalUser -name "smbuser" | ||
} | ||
catch [Microsoft.PowerShell.Commands.UserNotFoundException] { | ||
} |
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
Oops, something went wrong.