-
Notifications
You must be signed in to change notification settings - Fork 1
test: add unit test for sds_check #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+569
−43
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
0652d7c
test: add unit test for sds_check
osalyk 3f155fb
test: update return value
osalyk 49f65fa
test: apply comments to review
osalyk cf5ed83
test: minor adjustments
osalyk d2b3993
test: add match files
osalyk 99818ca
utils: add more logs
osalyk 1540b54
common: improve cstyle
osalyk 1c3cea6
test: update util_sds tests
osalyk ab7906a
common: improve logs
osalyk ddf54fc
common: update call_all.c.generated
osalyk c544f80
test: improve core_log_max test
osalyk 4519d94
common: update log messages
osalyk 6e9e7a4
common: update the logs
osalyk 258261f
test: improve logs
osalyk e9ce146
common: update tests
osalyk 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 hidden or 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 hidden or 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 hidden or 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
grom72 marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| // SPDX-License-Identifier: BSD-3-Clause | ||
| /* Copyright 2025, Hewlett Packard Enterprise Development LP */ | ||
|
|
||
| /* | ||
| * shutdown_state_helper.c -- implementation of shutdown_state_reinit | ||
| */ | ||
|
|
||
| #include "out.h" | ||
| #include "os_deep.h" | ||
| #include "set.h" | ||
|
|
||
| /* | ||
| * shutdown_state_reinit -- reinitializes shutdown_state struct | ||
| */ | ||
| void | ||
| shutdown_state_reinit(struct shutdown_state *curr_sds, | ||
| struct shutdown_state *pool_sds, struct pool_replica *rep) | ||
| { | ||
| LOG(3, "curr_sds %p, pool_sds %p", curr_sds, pool_sds); | ||
| shutdown_state_init(pool_sds, rep); | ||
| pool_sds->uuid = htole64(curr_sds->uuid); | ||
| pool_sds->usc = htole64(curr_sds->usc); | ||
| pool_sds->dirty = 0; | ||
|
|
||
| FLUSH_SDS(pool_sds, rep); | ||
|
|
||
| shutdown_state_checksum(pool_sds, rep); | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| <libpmem2>: <2> [shutdown_state.c:$(N) shutdown_state_check] Enabling ADR failure detection, assuming pool consistency up to this point. |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| <libpmem2>: <2> [shutdown_state.c:$(N) shutdown_state_check] Enabling ADR failure detection, assuming pool consistency up to this point. |
This file contains hidden or 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 |
|---|---|---|
| @@ -1 +1 @@ | ||
| <libpmem2>: <2> [shutdown_state.c:$(N) shutdown_state_check] an ADR failure was detected but the pool was closed - SDS will be reinitialized | ||
| <libpmem2>: <1> [shutdown_state.c:$(N) shutdown_state_check] The pool has moved to a new location but it was closed properly - reinitializing ADR failure detection. |
This file contains hidden or 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 |
|---|---|---|
| @@ -1 +1 @@ | ||
| <libpmem2>: <2> [shutdown_state.c:$(N) shutdown_state_check] the pool was not closed - SDS will be reinitialized | ||
| <libpmem2>: <2> [shutdown_state.c:$(N) shutdown_state_check] The ADR failure was detected but the pool was closed properly - reinitializing ADR failure detection. |
This file contains hidden or 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 |
|---|---|---|
| @@ -1 +1 @@ | ||
| <libpmem2>: <1> [shutdown_state.c:$(N) shutdown_state_check] an ADR failure was detected, the pool might be corrupted | ||
| <libpmem2>: <1> [shutdown_state.c:$(N) shutdown_state_check] The pool has moved to a new location while it was not closed properly, the pool might be corrupted. |
This file contains hidden or 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 |
|---|---|---|
| @@ -1 +1 @@ | ||
| <libpmem2>: <1> [shutdown_state.c:$(N) shutdown_state_check] an ADR failure was detected, the pool might be corrupted | ||
| <libpmem2>: <1> [shutdown_state.c:$(N) shutdown_state_check] The ADR failure was detected, the pool might be corrupted. |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| util_sds_check |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
| # Copyright 2025, Hewlett Packard Enterprise Development LP | ||
|
|
||
| # | ||
| # src/test/util_sds_check/Makefile -- shutdown_state_check unit test | ||
| # | ||
| BUILD_STATIC_DEBUG=n | ||
| BUILD_STATIC_NONDEBUG=n | ||
|
|
||
| TARGET = util_sds_check | ||
| OBJS = util_sds_check.o | ||
|
|
||
| LIBPMEM=y | ||
| LIBPMEMCOMMON=internal-debug | ||
|
|
||
| include ../Makefile.inc | ||
|
|
||
| LDFLAGS += $(call extract_funcs, util_sds_check.c) |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #!/usr/bin/env bash | ||
janekmi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # SPDX-License-Identifier: BSD-3-Clause | ||
| # Copyright 2025, Hewlett Packard Enterprise Development LP | ||
|
|
||
| # | ||
| # src/test/util_sds_check/TEST0 -- unittest for shutdown_state_check | ||
| # | ||
|
|
||
| . ../unittest/unittest.sh | ||
|
|
||
| require_test_type short | ||
|
|
||
| require_fs_type none | ||
|
|
||
| require_build_type debug | ||
|
|
||
| setup | ||
|
|
||
| expect_normal_exit ./util_sds_check test_dirty_clear | ||
|
|
||
| check | ||
|
|
||
| pass | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #!/usr/bin/env bash | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
| # Copyright 2025, Hewlett Packard Enterprise Development LP | ||
|
|
||
| # | ||
| # src/test/util_sds_check/TEST1 -- unittest for shutdown_state_check | ||
| # | ||
|
|
||
| . ../unittest/unittest.sh | ||
|
|
||
| require_test_type short | ||
|
|
||
| require_fs_type none | ||
|
|
||
| require_build_type debug | ||
|
|
||
| setup | ||
|
|
||
| expect_normal_exit ./util_sds_check test_invalid_checksum | ||
|
|
||
| check | ||
|
|
||
| pass |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #!/usr/bin/env bash | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
| # Copyright 2025, Hewlett Packard Enterprise Development LP | ||
|
|
||
| # | ||
| # src/test/util_sds_check/TEST2 -- unittest for shutdown_state_check | ||
| # | ||
|
|
||
| . ../unittest/unittest.sh | ||
|
|
||
| require_test_type short | ||
|
|
||
| require_fs_type none | ||
|
|
||
| require_build_type debug | ||
|
|
||
| setup | ||
|
|
||
| expect_normal_exit ./util_sds_check test_dirty_set | ||
|
|
||
| check | ||
|
|
||
| pass |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.