This commit is contained in:
Peter Hsu 2019-05-31 14:10:35 -07:00
Родитель 46c5ac5d93
Коммит be63a9c14b
5 изменённых файлов: 21 добавлений и 81 удалений

Просмотреть файл

@ -25,8 +25,8 @@
.PARAMETER test
Run the functional tests
.PARAMETER testPort
The port to use for service
.PARAMETER testEndpoint
The endpoint use to deploy test server, currently limited to localhost of a specific unused port
.PARAMETER installCheckRetryCount
.PARAMETER installCheckRetryPeriod
@ -55,8 +55,8 @@ param(
[switch]
$test,
[int]
$testPort = 44326,
[uri]
$testEndpoint = "https://localhost:43326",
[int]
$installCheckRetryCount = 20,
@ -86,7 +86,14 @@ function ForceResolvePath($path) {
}
function DevEnvSetup() {
& ([System.IO.Path]::Combine($scriptDir, "Configure-DevEnvironment.ps1")) -ConfigureTestEnvironment
& ([System.IO.Path]::Combine($scriptDir, "Configure-DevEnvironment.ps1")) -ConfigureTestEnvironment:$test -TestEndpoint:$testEndpoint
if ($test) {
$configPath = [System.IO.Path]::Combine($projectRoot, "test", "Microsoft.IIS.Administration.Tests", "test.config.json")
$config = ConvertFrom-Json (Get-Content -Raw $configPath)
$config.test_server = "$($testEndpoint.Scheme)://$($testEndpoint.Host)"
$config.test_port = $testEndpoint.Port
ConvertTo-Json $config -Depth 100 | Out-File $configPath -Force
}
}
function Publish() {
@ -129,8 +136,7 @@ function InstallTestService() {
}
Write-Host "$appName installed"
Write-Host "Sanity test:"
$pingEndpoint = "https://localhost:$testPort"
Invoke-WebRequest -UseDefaultCredentials -UseBasicParsing $pingEndpoint
Invoke-WebRequest -UseDefaultCredentials -UseBasicParsing $testEndpoint
Write-Host "Ping Successful"
}

Просмотреть файл

@ -3,7 +3,10 @@
Param(
[switch]
$ConfigureTestEnvironment
$ConfigureTestEnvironment,
[string]
$TestEndpoint = "https://localhost:43326"
)
#Requires -RunAsAdministrator
@ -68,7 +71,8 @@ try {
$env = @{
"iis_admin_test_dir" = (ConvertTo-Json $testRoot).Trim('"');
"project_dir" = $projectRoot
"project_dir" = $projectRoot;
"test_url" = $TestEndpoint
}
ReplaceTemplate ([System.IO.Path]::Combine($solutionRoot, "test", "appsettings.test.json.template")) $env
ReplaceTemplate ([System.IO.Path]::Combine($solutionRoot, "test", "Microsoft.IIS.Administration.Tests", "test.config.json.template")) $env

Просмотреть файл

@ -3,5 +3,5 @@
"project_path": "%project_dir%",
"test_server": "https://localhost",
"test_port": "44326",
"test_root_path": "%iis_admin_test_dir%",
"test_root_path": "%iis_admin_test_dir%"
}

Просмотреть файл

@ -1,70 +0,0 @@
{
"host_id": "",
"host_name": "IIS Administration API",
"urls": "https://*:44326",
"security": {
"require_windows_authentication": true,
"users": {
"administrators": [
"IIS Administrators",
"IIS Administration API Owners"
],
"owners": [
"IIS Administration API Owners"
]
},
"access_policy": {
"api": {
"users": "administrators",
"access_key": true
},
"api_keys": {
"users": "administrators",
"access_key": false
},
"system": {
"users": "owners",
"access_key": true
}
}
},
"logging": {
"enabled": true,
"file_name": "iis-admin-api-test-{Date}.txt",
"min_level": "Information",
"path": "%temp%\\iis-admin-api\\"
},
"auditing": {
"enabled": true,
"file_name": "audit-{Date}.txt",
"path": null
},
"cors": {
"rules": [
{
"origin": "https://manage.iis.net",
"allow": true
}
]
},
"files": {
"locations": [
{
"alias": "inetpub",
"path": "%systemdrive%\\inetpub",
"claims": [
"read",
"write"
]
},
{
"alias": "tests",
"path": "D:\\GitHub\\Microsoft\\IIS.Administration\\.test",
"claims": [
"read",
"write"
]
}
]
}
}

Просмотреть файл

@ -1,7 +1,7 @@
{
"host_id": "",
"host_name": "IIS Administration API",
"urls": "https://*:44326",
"urls": "%test_url%",
"security": {
"require_windows_authentication": true,
"users": {