Skip to content

Commit 3e26dbf

Browse files
author
ethanholen-hpe
committed
add-test-coverage-to-providers: bumped the sles version
1 parent ad28c91 commit 3e26dbf

File tree

2 files changed

+69
-3
lines changed

2 files changed

+69
-3
lines changed

Jenkinsfile.github

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pipeline {
4848
NAME = getRepoName()
4949
GO_VERSION = sh(returnStdout: true, script: 'grep -Eo "^go .*" go.mod | cut -d " " -f2').trim()
5050
VERSION = sh(returnStdout: true, script: "git describe --tags | tr -s '-' '~' | sed 's/^v//'").trim()
51-
51+
5252
}
5353

5454
stages {
@@ -82,7 +82,7 @@ pipeline {
8282
docker {
8383
label 'docker'
8484
reuseNode true
85-
image "${goImage}:${env.GO_VERSION}-SLES15.4"
85+
image "${goImage}:${env.GO_VERSION}-SLES15.5"
8686
}
8787
}
8888
steps {
@@ -97,7 +97,7 @@ pipeline {
9797
docker {
9898
label 'docker'
9999
reuseNode true
100-
image "${goImage}:${env.GO_VERSION}-SLES15.4"
100+
image "${goImage}:${env.GO_VERSION}-SLES15.5"
101101
}
102102
}
103103
steps {

spec/providers/example_spec.sh

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/usr/bin/env sh
2+
#
3+
# MIT License
4+
#
5+
# (C) Copyright 2025 Hewlett Packard Enterprise Development LP
6+
#
7+
# Permission is hereby granted, free of charge, to any person obtaining a
8+
# copy of this software and associated documentation files (the "Software"),
9+
# to deal in the Software without restriction, including without limitation
10+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
11+
# and/or sell copies of the Software, and to permit persons to whom the
12+
# Software is furnished to do so, subject to the following conditions:
13+
#
14+
# The above copyright notice and this permission notice shall be included
15+
# in all copies or substantial portions of the Software.
16+
#
17+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20+
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21+
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22+
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23+
# OTHER DEALINGS IN THE SOFTWARE.
24+
#
25+
26+
# ── add command ─────────────────────────────────────────────────────
27+
28+
Describe 'cani ochami tests'
29+
30+
# ── help & flags ────────────────────────────────────────────────
31+
32+
Describe 'base command'
33+
It 'exits 0 and shows help message'
34+
When call bin/cani alpha import ochami
35+
The status should equal 0
36+
End
37+
End
38+
39+
Describe 'import empty'
40+
It 'exits 0 and shows import completed successfully'
41+
When call bin/cani --datastore-path /tmp/tmpcanidb.json alpha import ochami -f testdata/fixtures/ochami/empty.json
42+
The status should equal 0
43+
The stderr should include 'No valid records found in JSON'
44+
The stderr should include 'Import completed successfully using provider ochami'
45+
End
46+
47+
It 'exits 1 and shows no such file or directory'
48+
When call bin/cani --datastore-path /tmp/tmpcanidb.json alpha import ochami -f badpath
49+
The status should equal 1
50+
The stderr should include 'no such file or directory'
51+
End
52+
End
53+
54+
55+
Describe 'import inventory'
56+
It 'calls the basic inventory import'
57+
When call bin/cani --datastore-path /tmp/tmpcanidb.json alpha import ochami -f testdata/fixtures/ochami/upload_request.json
58+
The status should equal 0
59+
The stderr should include '0 racks'
60+
The stderr should include '3 devices'
61+
The stderr should include '0 cables'
62+
The stderr should include 'Import completed successfully using provider ochami'
63+
End
64+
End
65+
End
66+

0 commit comments

Comments
 (0)