-
Notifications
You must be signed in to change notification settings - Fork 315
/
test_external_binaries.ps1
36 lines (31 loc) · 1.35 KB
/
test_external_binaries.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Describe "`hab` correctly executes external binaries" {
It "container exporter help" {
$le = "`n"
if ($IsWindows) {
$le = "`r`n"
}
$out = (hab pkg export container --help | Out-String)
$LastExitCode | Should -Be 0
$out | Should -BeLike "*Creates a container image from a set of Habitat packages (and optionally pushes to a remote${le}repository)*"
$out = (hab pkg export docker --help | Out-String)
$LastExitCode | Should -Be 0
$out | Should -BeLike "*Creates a container image from a set of Habitat packages (and optionally pushes to a remote${le}repository)*"
}
It "tar exporter help" {
$out = hab pkg export tar --help
$LastExitCode | Should -Be 0
"Creates a tar package from a Habitat package" | Should -BeIn $out
}
It "`hab pkg export` with bad exporter" {
hab pkg export a_bad_exporter --help
$LastExitCode | Should -Be 1
}
It "`hab sup --version` correctly reports version" {
# Install an use an old supervisor to ensure version match
Invoke-NativeCommand hab pkg install "core/hab-sup/1.6.56"
$env:HAB_SUP_BINARY = "$(hab pkg path core/hab-sup/1.6.56)/bin/hab-sup"
$out = hab sup --version | Join-String
$out | Should -BeLike "*1.6.56*"
$env:HAB_SUP_BINARY = ""
}
}