diff --git a/resource-tuner/core/CocoTable.cpp b/resource-tuner/core/CocoTable.cpp index a79f90c5a..c97b49ce7 100644 --- a/resource-tuner/core/CocoTable.cpp +++ b/resource-tuner/core/CocoTable.cpp @@ -452,6 +452,7 @@ int8_t CocoTable::removeRequest(Request* request) { } else { this->fastPathReset(resource); } + continue; } // Check if the node is currently at the head of it's resource DLL. diff --git a/tests/Configs/ResourcesConfig.yaml b/tests/Configs/ResourcesConfig.yaml index 49239cbe9..ee238ba0c 100644 --- a/tests/Configs/ResourcesConfig.yaml +++ b/tests/Configs/ResourcesConfig.yaml @@ -161,3 +161,15 @@ ResourceConfigs: Modes: ["display_on", "doze"] Policy: "instant_apply" ApplyType: "cgroup" + + - ResType: "0xff" + ResID: "0x000e" + Name: "TEST_RESOURCE_5" + Path: "/etc/urm/tests/nodes/target_test_resource1.txt" + Supported: true + HighThreshold: 400 + LowThreshold: 0 + Permissions: "system" + Modes: ["display_on", "display_off"] + Policy: "pass_through" + ApplyType: "global" diff --git a/tests/Integration/IntegrationTests.cpp b/tests/Integration/IntegrationTests.cpp index 31a6b962d..101e367ba 100644 --- a/tests/Integration/IntegrationTests.cpp +++ b/tests/Integration/IntegrationTests.cpp @@ -1385,6 +1385,127 @@ URM_TEST(TestMultipleClientsLazyApplyPolicy, { } }) +/** + * API under test: Tune / Untune + * - Single client sends requests for Provisioning a single resource, with certain duration + * - Here the resource in question has the "Pass-Through" policy, hence the configured value + * should be affected immediately. + */ +URM_TEST(TestSimplePassThroughApplication, { + // Check the original value for the Resource + std::string testResourceName = "/etc/urm/tests/nodes/target_test_resource1.txt"; + int32_t testResourceOriginalValue = 240; + + std::string value; + int32_t originalValue, newValue; + + value = AuxRoutines::readFromFile(testResourceName); + originalValue = C_STOI(value); + std::cout< d2 + * - Here the resource in question has the "Pass-Through" policy, hence the configured value + * should be affected immediately. + * The value configured by the request with a later timestamp will take effect, even when it expires + * the value will remain configured until both the requests for the resource have expired. + */ +URM_TEST(TestSimplePassThroughConcurrentApplication, { + // Check the original value for the Resource + std::string testResourceName = "/etc/urm/tests/nodes/target_test_resource1.txt"; + int32_t testResourceOriginalValue = 240; + + std::string value; + int32_t originalValue, newValue; + + value = AuxRoutines::readFromFile(testResourceName); + originalValue = C_STOI(value); + std::cout< 0) { + wait(nullptr); + + SysResource* resourceList = new SysResource[1]; + memset(&resourceList[0], 0, sizeof(SysResource)); + resourceList[0].mResCode = CONSTRUCT_RES_CODE(0xff, 0x000e); + resourceList[0].mNumValues = 1; + resourceList[0].mResValue.value = 394; + + int64_t handle = tuneResources(8000, RequestPriority::REQ_PRIORITY_HIGH, 1, resourceList); + std::cout<