Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisvang committed Nov 24, 2023
1 parent 4c623a3 commit 79c2b41
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test_update_cycle.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
$ErrorActionPreference = "stop"

# exit on executable errors (for use directly after executable call)
function Assert-ExeSucces {
function Assert-ExeSuccess {
if (!$?) {
# note $? contains the execution status of the last command (true if successful)
Write-Error "failed"
Expand Down Expand Up @@ -95,7 +95,7 @@ $Env:PYTHONPATH += ";$repo_dir\src"
# - initialize new repository
Write-Host "initializing tuf repository for $app_name" -ForegroundColor green
python "$repo_dir\repo_init.py"
Assert-ExeSucces
Assert-ExeSuccess

# - create my_app v1.0 bundle using pyinstaller
Write-Host "creating $app_name v1.0 bundle" -ForegroundColor green
Expand All @@ -106,7 +106,7 @@ Pop-Location
# - add my_app v1.0 to tufup repository
Write-Host "adding $app_name v1.0 bundle to repo" -ForegroundColor green
python "$repo_dir\repo_add_bundle.py"
Assert-ExeSucces
Assert-ExeSuccess

# - mock install my_app v1.0
Write-Host "installing $app_name v1.0 in $app_install_dir" -ForegroundColor green
Expand Down Expand Up @@ -134,7 +134,7 @@ Pop-Location
# - add my_app v2.0 to tufup repository
Write-Host "adding $app_name v2.0 bundle to repo" -ForegroundColor green
python "$repo_dir\repo_add_bundle.py"
Assert-ExeSucces
Assert-ExeSuccess

# - roll-back modified source
Write-Host "rolling back temporary source modification" -ForegroundColor green
Expand All @@ -145,21 +145,21 @@ Write-Host "starting update server" -ForegroundColor green
$job = Start-Job -ArgumentList @("$temp_dir\repository") -ScriptBlock {
param($repository_path)
python -m http.server -d $repository_path
Assert-ExeSucces
Assert-ExeSuccess
}
sleep 1 # not sure if this is required, but cannot hurt

# - run my_app to update from v1 to v2
Write-Host "running $app_name for update..." -ForegroundColor green
Invoke-Expression "$app_install_dir\main.exe"
Assert-ExeSucces
Assert-ExeSuccess

# - run my_app again to verify we now have v2.0
Write-Host "hit enter to proceed, after console has closed:" -ForegroundColor yellow -NoNewLine
Read-Host # no text: we use write host to add color
Write-Host "running $app_name again to verify version" -ForegroundColor green
$output = Invoke-Expression "$app_install_dir\main.exe"
Assert-ExeSucces
Assert-ExeSuccess

# - stop update server
Write-Host "stopping server" -ForegroundColor green
Expand Down

0 comments on commit 79c2b41

Please sign in to comment.