From 94e0ae0427649517ce652fa24eac98e3ad2064fd Mon Sep 17 00:00:00 2001 From: Oksana Salyk Date: Thu, 25 Jul 2024 10:18:12 +0200 Subject: [PATCH] check USCDiff --- src/tests/ras/utils/inject_manager/inject_manager.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/tests/ras/utils/inject_manager/inject_manager.cc b/src/tests/ras/utils/inject_manager/inject_manager.cc index 86dafcd..b5baf65 100644 --- a/src/tests/ras/utils/inject_manager/inject_manager.cc +++ b/src/tests/ras/utils/inject_manager/inject_manager.cc @@ -1,5 +1,5 @@ /* - * Copyright 2018-2023, Intel Corporation + * Copyright 2018-2024, Intel Corporation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -108,6 +108,7 @@ const std::vector InjectManager::GetDimmsToInject( bool InjectManager::CheckUSCDiff( const std::vector &dimm_namespaces, std::function compare) const { + bool ret = true; for (const auto &dn : dimm_namespaces) { for (const auto &d : GetDimmsToInject(dn)) { int recorded_usc = ReadRecordedUSC(test_dir_ + d.GetUid()); @@ -115,7 +116,7 @@ bool InjectManager::CheckUSCDiff( if (recorded_usc == -1) { std::cerr << "Could not read USC in DIMM: " << d.GetUid() << " with test dir: " << dn.GetTestDir() << std::endl; - return false; + ret = false; } if (!compare(recorded_usc, d.GetShutdownCount())) { @@ -123,11 +124,14 @@ bool InjectManager::CheckUSCDiff( << " (test dir: " << dn.GetTestDir() << "). Current USC: " << d.GetShutdownCount() << " Last recorded USC: " << recorded_usc << std::endl; - return false; + ret = false; + } + else { + std::cout << " Last recorded USC: " << recorded_usc << std::endl; } } } - return true; + return ret; } InjectManager::InjectManager(std::string test_dir, std::string policy) {