summaryrefslogtreecommitdiff
path: root/habitat/tests/test.pester.ps1
diff options
context:
space:
mode:
Diffstat (limited to 'habitat/tests/test.pester.ps1')
-rw-r--r--habitat/tests/test.pester.ps155
1 files changed, 55 insertions, 0 deletions
diff --git a/habitat/tests/test.pester.ps1 b/habitat/tests/test.pester.ps1
new file mode 100644
index 0000000000..a5f665c9de
--- /dev/null
+++ b/habitat/tests/test.pester.ps1
@@ -0,0 +1,55 @@
+param(
+ [Parameter()]
+ [string]$PackageIdentifier = $(throw "Usage: test.ps1 [test_pkg_ident] e.g. test.ps1 ci/user-windows-default/1.0.0/20190812103929")
+)
+
+$PackageVersion = $PackageIdentifier.split('/')[2]
+
+Describe "chef-infra-client" {
+ Context "chef-client" {
+ It "is an executable" {
+ hab pkg exec $PackageIdentifier chef-client.bat --version
+ $? | Should be $true
+ }
+
+ It "is the expected version" {
+ $the_version = (hab pkg exec $PackageIdentifier chef-client.bat --version | Out-String).split(':')[1].Trim()
+ $the_version | Should be $PackageVersion
+ }
+ }
+
+ Context "ohai" {
+ It "is an executable" {
+ hab pkg exec $PackageIdentifier ohai.bat --version
+ $? | Should be $true
+ }
+ }
+
+ Context "chef-shell" {
+ It "is an executable" {
+ hab pkg exec $PackageIdentifier chef-shell.bat --version
+ $? | Should be $true
+ }
+ }
+
+ Context "chef-apply" {
+ It "is an executable" {
+ hab pkg exec $PackageIdentifier chef-apply.bat --version
+ $? | Should be $true
+ }
+ }
+
+ Context "knife" {
+ It "is an executable" {
+ hab pkg exec $PackageIdentifier knife.bat --version
+ $? | Should be $true
+ }
+ }
+
+ Context "chef-solo" {
+ It "is an executable" {
+ hab pkg exec $PackageIdentifier chef-solo.bat --version
+ $? | Should be $true
+ }
+ }
+} \ No newline at end of file