Skip to content
This repository has been archived by the owner on Mar 24, 2020. It is now read-only.

Commit

Permalink
Merge pull request #13 from rn/test-reorg
Browse files Browse the repository at this point in the history
Reorganise the test to follow 'docker <command>'
  • Loading branch information
rn authored Mar 1, 2018
2 parents 9ca2bb6 + 22b0a69 commit 1df29d7
Show file tree
Hide file tree
Showing 74 changed files with 63 additions and 44 deletions.
7 changes: 1 addition & 6 deletions tests/cases/010_basic/001_info/test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,4 @@ if ($lastexitcode -ne 0) {
}
$output

# Check that we use lcow
$tmp = $output | select-string "lcow (linux)" -SimpleMatch
if ($tmp.length -eq 0) {
exit 1
}
exit 0
exit 0
37 changes: 0 additions & 37 deletions tests/cases/010_basic/020_inspect/test.ps1

This file was deleted.

2 changes: 1 addition & 1 deletion tests/cases/010_basic/030_busybox/test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if ($lastexitcode -ne 0) {
$output

# Check that we use lcow
$tmp = $output | select-string "-linuxkit" -SimpleMatch
$tmp = $output | select-string "Linux" -SimpleMatch
if ($tmp.length -eq 0) {
exit 1
}
Expand Down
22 changes: 22 additions & 0 deletions tests/cases/020_image/050_inspect/test.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# SUMMARY: Check that docker image inspect works
# LABELS:
# REPEAT:

Set-PSDebug -Trace 2

$imageName = "hello-world"

docker image pull --platform linux $imageName
if ($lastexitcode -ne 0) {
exit 1
}

$output = [string] (& docker inspect $imageName 2>&1)
if ($lastexitcode -ne 0) {
$output
exit 1
}
Write-Output "Output of docker inspect of the image:"
$output | ConvertFrom-Json | ConvertTo-Json

exit 0
28 changes: 28 additions & 0 deletions tests/cases/030_container/040_inspect/test.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# SUMMARY: Check that docker container inspect works
# LABELS:
# REPEAT:

Set-PSDebug -Trace 2

$imageName = "hello-world"
$containerName = "inspect_test"

docker container run --platform linux --name $containerName $imageName
if ($lastexitcode -ne 0) {
exit 1
}

$output = [string] (& docker container inspect $containerName 2>&1)
if ($lastexitcode -ne 0) {
$output
docker rm --force $containerName
exit 1
}
Write-Output "Output of docker inspect of the container:"
$output | ConvertFrom-Json | ConvertTo-Json

docker container rm --force $containerName
if ($lastexitcode -ne 0) {
exit 1
}
exit 0
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Set-PSDebug -Trace 2

$imageName = "rmdir-nonempty"
$fileName = "output"

docker build --platform linux -t $imageName .
if ($lastexitcode -ne 0) {
Expand All @@ -14,6 +15,12 @@ if ($lastexitcode -ne 0) {
$p = [string]$pwd.Path
docker run --rm -v $p`:/test $imageName /rmdir_test.sh /test
if ($lastexitcode -ne 0) {
if (Test-Path $fileName) {
Remove-Item -Path $fileName -Force
}
exit 1
}
if (Test-Path $fileName) {
Remove-Item -Path $fileName -Force
}
exit 0
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,8 @@ if ($lastexitcode -ne 0) {
}
exit 1
}

if (Test-Path $fileName) {
Remove-Item -Path $fileName -Force
}
exit 0
File renamed without changes.
File renamed without changes.

0 comments on commit 1df29d7

Please sign in to comment.