This repository has been archived by the owner on Oct 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
Devicemanager: New error codes + Device Manager unit tests and few other fixes. #420
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c0537d3
DeviceManager: Remove unused method: FlushDeviceData()
avalluri 08dd1ea
DeviceManager: define error codes
avalluri 8feea9f
DeviceManager: Return no error if the device not found while deleting
avalluri 6a2336a
ndctl: Consider only non-zero sized namespaces while retrieving names…
avalluri 522da48
DeviceManager: Added unit tests
avalluri 205ffc8
tests: run device manager unit tests inside virtual machine
avalluri b7cb533
Jenkinsfile: Add new build stage for running device manager tests
avalluri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -159,6 +159,26 @@ pipeline { | |
} | ||
} | ||
|
||
stage('make dm-test') { | ||
options { | ||
timeout(time: 30, unit: "MINUTES") | ||
} | ||
|
||
steps { | ||
sh "docker run --rm ${DockerBuildArgs()} \ | ||
--privileged=true \ | ||
-e TEST_CHECK_SIGNED_FILES=false \ | ||
-e TEST_DISTRO=clear \ | ||
-e TEST_DISTRO_VERSION=${env.CLEAR_LINUX_VERSION_1_15} \ | ||
-v `pwd`:`pwd`:rshared \ | ||
-w `pwd` \ | ||
${env.BUILD_IMAGE} bash -c 'set -x; \ | ||
swupd bundle-add openssh-client && \ | ||
make run_dm_tests; \ | ||
make stop'" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This step is now treated as success even if |
||
} | ||
} | ||
|
||
stage('Build test image') { | ||
options { | ||
timeout(time: 60, unit: "MINUTES") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,7 +93,9 @@ func (r *Region) ActiveNamespaces() []*Namespace { | |
return r.namespaces(true) | ||
} | ||
|
||
//AllNamespaces returns all namespaces in the region | ||
//AllNamespaces returns all non-zero sized namespaces in the region | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a comment here explaining why it ignores namespaces with zero size? I know its in the commit message, but that's not necessarily where someone will look when reading this description. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
//as sometime a deleted namespace also lies around with size zero, we can ignore | ||
//such namespace | ||
func (r *Region) AllNamespaces() []*Namespace { | ||
return r.namespaces(false) | ||
} | ||
|
@@ -318,8 +320,15 @@ func (r *Region) namespaces(onlyActive bool) []*Namespace { | |
ndr := (*C.struct_ndctl_region)(r) | ||
|
||
for ndns := C.ndctl_namespace_get_first(ndr); ndns != nil; ndns = C.ndctl_namespace_get_next(ndns) { | ||
if !onlyActive || C.ndctl_namespace_is_active(ndns) == true { | ||
namespaces = append(namespaces, (*Namespace)(ndns)) | ||
ns := (*Namespace)(ndns) | ||
// If asked for only active namespaces return it regardless of it size | ||
// if not, return only valid namespaces, i.e, non-zero sized. | ||
if onlyActive { | ||
if ns.Active() { | ||
namespaces = append(namespaces, ns) | ||
} | ||
} else if ns.Size() > 0 { | ||
namespaces = append(namespaces, ns) | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this an experiment to figure out how long this stage will take?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is one reason, and the other is to run the docker with
--privileged=true
to run dm tests.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pohly do you have any clue why
ssh-keygen
is failing at this stage:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does
_work/resources
exist?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be created by the previous command line, which does not throw any error. So I assume it exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When printing
ssh-keygen
output revealed thatssh-keygen
command not found. https://cloudnative-k8sci.southcentralus.cloudapp.azure.com/blue/organizations/jenkins/pmem-csi/detail/PR-420/20/pipeline#step-63-log-114There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pohly Running device manager tests in VM took around 3 and half minutes in CI.
make dm-test - 3m 23s