Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ utest: bin ## Run unit tests
.PHONY: ftest
ftest: bin ## Run functional tests
$(INFO) "running functional tests"
./spec/support/bin/cani_integrate.sh functional
shellspec ./spec/functional -f tap
$(OK) "functional tests passed"

.PHONY: itest
Expand Down
47 changes: 47 additions & 0 deletions spec/functional/add_cable_spec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env sh
#
# MIT License
#
# (C) Copyright 2026 Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#

# ── add cable ───────────────────────────────────────────────────────

Describe 'cani alpha add cable'

Describe 'valid slug'
It 'adds a cable with a known slug'
When call bin/cani alpha add cable hpe-cat5-rj45-4-3m-cable --config "$CANI_CONF"
The status should equal 0
The stderr should include 'Added cable'
The stderr should include '1 cable(s) added'
End
End

Describe 'invalid slug'
It 'rejects an unknown slug'
When call bin/cani alpha add cable nonexistent-slug
The status should equal 1
The stderr should include 'unknown cable slug or part number'
End
End

End
47 changes: 47 additions & 0 deletions spec/functional/add_device_spec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env sh
#
# MIT License
#
# (C) Copyright 2026 Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#

# ── add device ──────────────────────────────────────────────────────

Describe 'cani alpha add device'

Describe 'valid slug'
It 'adds a device with a known slug'
When call bin/cani alpha add device cray-xd225v --config "$CANI_CONF"
The status should equal 0
The stderr should include 'Added device'
The stderr should include 'device(s) added'
End
End

Describe 'invalid slug'
It 'rejects an unknown slug'
When call bin/cani alpha add device nonexistent-slug
The status should equal 1
The stderr should include 'unknown device slug or part number: nonexistent-slug'
End
End

End
47 changes: 47 additions & 0 deletions spec/functional/add_module_spec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env sh
#
# MIT License
#
# (C) Copyright 2026 Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#

# ── add module ──────────────────────────────────────────────────────

Describe 'cani alpha add module'

Describe 'valid slug'
It 'adds a module with a known slug'
When call bin/cani alpha add module hpe-1600w-flex-slot-platinum-hot-plug-psu --config "$CANI_CONF"
The status should equal 0
The stderr should include 'Added module'
The stderr should include '1 module(s) added'
End
End

Describe 'invalid slug'
It 'rejects an unknown slug'
When call bin/cani alpha add module nonexistent-slug
The status should equal 1
The stderr should include 'unknown module slug or part number'
End
End

End
47 changes: 47 additions & 0 deletions spec/functional/add_rack_spec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env sh
#
# MIT License
#
# (C) Copyright 2026 Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#

# ── add rack ────────────────────────────────────────────────────────

Describe 'cani alpha add rack'

Describe 'valid slug'
It 'adds a rack with a known slug'
When call bin/cani alpha add rack hpe-48u-800mmx1200mm-g2-enterprise-shock-rack --config "$CANI_CONF"
The status should equal 0
The stderr should include 'Added rack'
The stderr should include '1 rack(s) added'
End
End

Describe 'invalid slug'
It 'rejects an unknown slug'
When call bin/cani alpha add rack nonexistent-slug
The status should equal 1
The stderr should include 'unknown rack slug or part number'
End
End

End
Loading
Loading