Skip to content

Commit

Permalink
guess test case
Browse files Browse the repository at this point in the history
  • Loading branch information
osalyk committed Jul 19, 2024
1 parent 5be3af9 commit c2310b3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
24 changes: 12 additions & 12 deletions src/tests/ras/utils/inject_manager/inject_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,18 @@ InjectManager::InjectManager(std::string test_dir, std::string policy) {
test_dir_ = test_dir;
}

bool InjectManager::IsLastShutdownUnsafe(
const std::vector<DimmNamespace> &dimm_namespaces) const {
std::function<bool(int, int)> compare = [](int rec, int cur) -> bool {
return cur > rec;
};

if (!CheckUSCDiff(dimm_namespaces, compare)) {
std::cerr << "Unexpected safe shutdown of NVDIMM" << std::endl;
return false;
}
return true;
}
// bool InjectManager::IsLastShutdownUnsafe(
// const std::vector<DimmNamespace> &dimm_namespaces) const {
// std::function<bool(int, int)> compare = [](int rec, int cur) -> bool {
// return cur > rec;
// };

// if (!CheckUSCDiff(dimm_namespaces, compare)) {
// std::cerr << "Unexpected safe shutdown of NVDIMM" << std::endl;
// return false;
// }
// return true;
// }

bool InjectManager::IsLastShutdownSafe(
const std::vector<DimmNamespace> &dimm_namespaces) const {
Expand Down
4 changes: 2 additions & 2 deletions src/tests/ras/utils/inject_manager/inject_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class InjectManager {

InjectManager(std::string test_dir, std::string policy);

bool IsLastShutdownUnsafe(
const std::vector<DimmNamespace> &dimm_namespaces) const;
// bool IsLastShutdownUnsafe(
// const std::vector<DimmNamespace> &dimm_namespaces) const;
bool IsLastShutdownSafe(
const std::vector<DimmNamespace> &dimm_namespaces) const;
int RecordUSC(const std::vector<DimmNamespace> &dimm_namespaces) const;
Expand Down
3 changes: 1 addition & 2 deletions src/tests/ras/utils/test_phase/local_test_phase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ int LocalTestPhase::Inject() const {

int LocalTestPhase::CheckUSC() const {
InjectManager inject_mgmt{config_.GetTestDir(), policy_};
if (inject_mgmt.IsLastShutdownSafe(safe_namespaces) &&
inject_mgmt.IsLastShutdownUnsafe(unsafe_namespaces)) {
if (inject_mgmt.IsLastShutdownSafe(safe_namespaces)) {
return 0;
}
return -1;
Expand Down

0 comments on commit c2310b3

Please sign in to comment.