-
Notifications
You must be signed in to change notification settings - Fork 4
Copilot L1 Test generation #164
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
base: develop
Are you sure you want to change the base?
Conversation
| stateFound = true; | ||
| } | ||
| if (key == "substate") { | ||
| substate = value; |
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.
Coverity Issue - Variable copied when it could be moved
"value" is copied in call to copy assignment for class "std::string", when it could be moved instead.
Low Impact, CWE-none
COPY_INSTEAD_OF_MOVE
How to fix
Use "std::move(""value"")" instead of "value".
| std::ofstream script("/lib/rdk/imageFlasher.sh"); | ||
| script << "#!/bin/sh\nexit 0\n"; | ||
| } | ||
| chmod("/lib/rdk/imageFlasher.sh", 0755); |
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.
Coverity Issue - Unchecked return value from library
Calling "chmod("/lib/rdk/imageFlasher.sh", 493U)" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
| std::this_thread::sleep_for(std::chrono::milliseconds(900)); | ||
| EXPECT_NE(0, access(headerFile.c_str(), F_OK)); // Header file should be deleted | ||
|
|
||
| std::remove("/etc/device.properties"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/etc/device.properties")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
| EXPECT_NE(0, access(headerFile.c_str(), F_OK)); // Header file should be deleted | ||
|
|
||
| std::remove("/etc/device.properties"); | ||
| std::remove("/lib/rdk/imageFlasher.sh"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/lib/rdk/imageFlasher.sh")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
| std::ofstream script("/lib/rdk/imageFlasher.sh"); | ||
| script << "#!/bin/sh\nexit 0\n"; | ||
| } | ||
| chmod("/lib/rdk/imageFlasher.sh", 0755); |
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.
Coverity Issue - Unchecked return value from library
Calling "chmod("/lib/rdk/imageFlasher.sh", 493U)" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
|
|
||
| /* Test: Notification Register/Unregister around a successful update (event delivery check) */ | ||
| TEST_F(FirmwareUpdateTest, Notification_ReceiveUpdateStateChange) { | ||
| system("mkdir -p /lib/rdk"); |
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.
Coverity Issue - Unchecked return value
Calling "system" without checking return value (as is done elsewhere 3 out of 3 times).
Medium Impact, CWE-252
CHECKED_RETURN
| // Non-mediaclient success triggers FLASHING_SUCCEEDED via usb path then WAITING_FOR_REBOOT | ||
| EXPECT_TRUE(state == "FLASHING_SUCCEEDED" || state == "WAITING_FOR_REBOOT"); | ||
|
|
||
| std::remove("/etc/device.properties"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/etc/device.properties")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
| EXPECT_TRUE(state == "FLASHING_SUCCEEDED" || state == "WAITING_FOR_REBOOT"); | ||
|
|
||
| std::remove("/etc/device.properties"); | ||
| std::remove("/lib/rdk/imageFlasher.sh"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/lib/rdk/imageFlasher.sh")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
| // Firmware file should be deleted on success for mediaclient | ||
| EXPECT_NE(0, access(TEST_FIRMWARE_PATH.c_str(), F_OK)); | ||
|
|
||
| std::remove("/etc/device.properties"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/etc/device.properties")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
| EXPECT_NE(0, access(TEST_FIRMWARE_PATH.c_str(), F_OK)); | ||
|
|
||
| std::remove("/etc/device.properties"); | ||
| std::remove("/lib/rdk/imageFlasher.sh"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/lib/rdk/imageFlasher.sh")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
|
|
||
| std::this_thread::sleep_for(std::chrono::milliseconds(800)); | ||
|
|
||
| std::remove("/etc/device.properties"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/etc/device.properties")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
| std::this_thread::sleep_for(std::chrono::milliseconds(800)); | ||
|
|
||
| std::remove("/etc/device.properties"); | ||
| std::remove("/lib/rdk/imageFlasher.sh"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/lib/rdk/imageFlasher.sh")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
|
|
||
| std::remove("/etc/device.properties"); | ||
| std::remove("/lib/rdk/imageFlasher.sh"); | ||
| std::remove("/opt/swupdate_maintenance_upgrade"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/opt/swupdate_maintenance_upgrade")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
|
|
||
| /* Test: UpdateFirmware Failure Path (non-mediaclient x86) ensures state FAILED and file retained */ | ||
| TEST_F(FirmwareUpdateTest, UpdateFirmware_FlashImage_Failure_NonMediaClient_X86) { | ||
| system("mkdir -p /lib/rdk"); |
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.
Coverity Issue - Unchecked return value
Calling "system" without checking return value (as is done elsewhere 3 out of 3 times).
Medium Impact, CWE-252
CHECKED_RETURN
| uint32_t rc2 = handler.Invoke(connection, _T("updateFirmware"), req2, response); | ||
| EXPECT_NE(Core::ERROR_NONE, rc2); // Should return in-progress error code | ||
|
|
||
| std::remove("/etc/device.properties"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/etc/device.properties")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
|
|
||
| /* Test: Notification Register/Unregister around a successful update (event delivery check) */ | ||
| TEST_F(FirmwareUpdateTest, Notification_ReceiveUpdateStateChange) { | ||
| system("mkdir -p /lib/rdk"); |
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.
Coverity Issue - Unchecked return value
Calling "system" without checking return value (as is done elsewhere 3 out of 3 times).
Medium Impact, CWE-252
CHECKED_RETURN
| // Non-mediaclient success triggers FLASHING_SUCCEEDED via usb path then WAITING_FOR_REBOOT | ||
| EXPECT_TRUE(state == "FLASHING_SUCCEEDED" || state == "WAITING_FOR_REBOOT"); | ||
|
|
||
| std::remove("/etc/device.properties"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/etc/device.properties")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
| EXPECT_TRUE(state == "FLASHING_SUCCEEDED" || state == "WAITING_FOR_REBOOT"); | ||
|
|
||
| std::remove("/etc/device.properties"); | ||
| std::remove("/lib/rdk/imageFlasher.sh"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/lib/rdk/imageFlasher.sh")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
| // Firmware file should be deleted on success for mediaclient | ||
| EXPECT_NE(0, access(TEST_FIRMWARE_PATH.c_str(), F_OK)); | ||
|
|
||
| std::remove("/etc/device.properties"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/etc/device.properties")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
| EXPECT_NE(0, access(TEST_FIRMWARE_PATH.c_str(), F_OK)); | ||
|
|
||
| std::remove("/etc/device.properties"); | ||
| std::remove("/lib/rdk/imageFlasher.sh"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/lib/rdk/imageFlasher.sh")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
|
|
||
| /* Test: UpdateFirmware Request Accepted for MediaClient Device */ | ||
| TEST_F(FirmwareUpdateTest, UpdateFirmware_FlashImage_MediaClient_RequestAccepted) { | ||
| system("mkdir -p /lib/rdk"); |
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.
Coverity Issue - Unchecked return value
Calling "system" without checking return value (as is done elsewhere 3 out of 3 times).
Medium Impact, CWE-252
CHECKED_RETURN
| std::ofstream script("/lib/rdk/imageFlasher.sh"); | ||
| script << "#!/bin/sh\nexit 0\n"; | ||
| } | ||
| chmod("/lib/rdk/imageFlasher.sh", 0755); |
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.
Coverity Issue - Unchecked return value from library
Calling "chmod("/lib/rdk/imageFlasher.sh", 493U)" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
| std::ofstream script("/lib/rdk/imageFlasher.sh"); | ||
| script << "#!/bin/sh\necho 'Flashing...'\nexit 0\n"; | ||
| } | ||
| chmod("/lib/rdk/imageFlasher.sh", 0755); |
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.
Coverity Issue - Unchecked return value from library
Calling "chmod("/lib/rdk/imageFlasher.sh", 493U)" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
|
|
||
| /* Test: UpdateFirmware State Progression for MediaClient Success */ | ||
| TEST_F(FirmwareUpdateTest, UpdateFirmware_FlashImage_Success_StateProgression) { | ||
| system("mkdir -p /lib/rdk"); |
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.
Coverity Issue - Unchecked return value
Calling "system" without checking return value (as is done elsewhere 3 out of 3 times).
Medium Impact, CWE-252
CHECKED_RETURN
|
|
||
| FirmwareUpdateImpl->Unregister(notify.get()); | ||
|
|
||
| std::remove("/etc/device.properties"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/etc/device.properties")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
|
|
||
| /* Test: flashImage failure with maintenance mode true for mediaclient */ | ||
| TEST_F(FirmwareUpdateTest, UpdateFirmware_FlashImage_Failure_MaintenanceMode_MediaClient) { | ||
| system("mkdir -p /lib/rdk /opt"); |
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.
Coverity Issue - Unchecked return value
Calling "system" without checking return value (as is done elsewhere 3 out of 3 times).
Medium Impact, CWE-252
CHECKED_RETURN
| std::ofstream script("/lib/rdk/imageFlasher.sh"); | ||
| script << "#!/bin/sh\nexit 2\n"; | ||
| } | ||
| chmod("/lib/rdk/imageFlasher.sh", 0755); |
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.
Coverity Issue - Unchecked return value from library
Calling "chmod("/lib/rdk/imageFlasher.sh", 493U)" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
|
|
||
| /* Test: Notification Register/Unregister around a successful update (event delivery check) */ | ||
| TEST_F(FirmwareUpdateTest, Notification_ReceiveUpdateStateChange) { | ||
| system("mkdir -p /lib/rdk"); |
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.
Coverity Issue - Unchecked return value
Calling "system" without checking return value (as is done elsewhere 3 out of 3 times).
Medium Impact, CWE-252
CHECKED_RETURN
| // Non-mediaclient success triggers FLASHING_SUCCEEDED via usb path then WAITING_FOR_REBOOT | ||
| EXPECT_TRUE(state == "FLASHING_SUCCEEDED" || state == "WAITING_FOR_REBOOT"); | ||
|
|
||
| std::remove("/etc/device.properties"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/etc/device.properties")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
| EXPECT_TRUE(state == "FLASHING_SUCCEEDED" || state == "WAITING_FOR_REBOOT"); | ||
|
|
||
| std::remove("/etc/device.properties"); | ||
| std::remove("/lib/rdk/imageFlasher.sh"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/lib/rdk/imageFlasher.sh")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
|
|
||
| /* Test: UpdateFirmware Request Validation - MediaClient Device Type Detected */ | ||
| TEST_F(FirmwareUpdateTest, UpdateFirmware_MediaClient_DeviceTypeCheck) { | ||
| system("mkdir -p /lib/rdk"); |
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.
Coverity Issue - Unchecked return value
Calling "system" without checking return value (as is done elsewhere 3 out of 3 times).
Medium Impact, CWE-252
CHECKED_RETURN
| std::ofstream script("/lib/rdk/imageFlasher.sh"); | ||
| script << "#!/bin/sh\nexit 0\n"; | ||
| } | ||
| chmod("/lib/rdk/imageFlasher.sh", 0755); |
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.
Coverity Issue - Unchecked return value from library
Calling "chmod("/lib/rdk/imageFlasher.sh", 493U)" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
| // Wait long enough for thread to fully complete | ||
| std::this_thread::sleep_for(std::chrono::milliseconds(3000)); | ||
|
|
||
| std::remove("/etc/device.properties"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/etc/device.properties")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
| std::this_thread::sleep_for(std::chrono::milliseconds(3000)); | ||
|
|
||
| std::remove("/etc/device.properties"); | ||
| std::remove("/lib/rdk/imageFlasher.sh"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/lib/rdk/imageFlasher.sh")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
| std::ofstream script("/lib/rdk/imageFlasher.sh"); | ||
| script << "#!/bin/sh\nexit 0\n"; | ||
| } | ||
| chmod("/lib/rdk/imageFlasher.sh", 0755); |
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.
Coverity Issue - Unchecked return value from library
Calling "chmod("/lib/rdk/imageFlasher.sh", 493U)" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
|
|
||
| /* Test: flashImage failure with maintenance mode true for mediaclient */ | ||
| TEST_F(FirmwareUpdateTest, UpdateFirmware_FlashImage_Failure_MaintenanceMode_MediaClient) { | ||
| system("mkdir -p /lib/rdk /opt"); |
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.
Coverity Issue - Unchecked return value
Calling "system" without checking return value (as is done elsewhere 3 out of 3 times).
Medium Impact, CWE-252
CHECKED_RETURN
| std::ofstream script("/lib/rdk/imageFlasher.sh"); | ||
| script << "#!/bin/sh\nexit 2\n"; | ||
| } | ||
| chmod("/lib/rdk/imageFlasher.sh", 0755); |
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.
Coverity Issue - Unchecked return value from library
Calling "chmod("/lib/rdk/imageFlasher.sh", 493U)" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
|
|
||
| /* Test: Notification Register/Unregister around a successful update (event delivery check) */ | ||
| TEST_F(FirmwareUpdateTest, Notification_ReceiveUpdateStateChange) { | ||
| system("mkdir -p /lib/rdk"); |
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.
Coverity Issue - Unchecked return value
Calling "system" without checking return value (as is done elsewhere 3 out of 3 times).
Medium Impact, CWE-252
CHECKED_RETURN
| // Non-mediaclient success triggers FLASHING_SUCCEEDED via usb path then WAITING_FOR_REBOOT | ||
| EXPECT_TRUE(state == "FLASHING_SUCCEEDED" || state == "WAITING_FOR_REBOOT"); | ||
|
|
||
| std::remove("/etc/device.properties"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/etc/device.properties")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
| EXPECT_TRUE(state == "FLASHING_SUCCEEDED" || state == "WAITING_FOR_REBOOT"); | ||
|
|
||
| std::remove("/etc/device.properties"); | ||
| std::remove("/lib/rdk/imageFlasher.sh"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/lib/rdk/imageFlasher.sh")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
|
|
||
| /* Test: UpdateFirmware Request Validation - MediaClient Device Type Detected */ | ||
| TEST_F(FirmwareUpdateTest, UpdateFirmware_MediaClient_DeviceTypeCheck) { | ||
| system("mkdir -p /lib/rdk"); |
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.
Coverity Issue - Unchecked return value
Calling "system" without checking return value (as is done elsewhere 3 out of 3 times).
Medium Impact, CWE-252
CHECKED_RETURN
| std::ofstream script("/lib/rdk/imageFlasher.sh"); | ||
| script << "#!/bin/sh\nexit 0\n"; | ||
| } | ||
| chmod("/lib/rdk/imageFlasher.sh", 0755); |
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.
Coverity Issue - Unchecked return value from library
Calling "chmod("/lib/rdk/imageFlasher.sh", 493U)" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
| // Wait long enough for thread to fully complete | ||
| std::this_thread::sleep_for(std::chrono::milliseconds(3000)); | ||
|
|
||
| std::remove("/etc/device.properties"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/etc/device.properties")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
| std::this_thread::sleep_for(std::chrono::milliseconds(3000)); | ||
|
|
||
| std::remove("/etc/device.properties"); | ||
| std::remove("/lib/rdk/imageFlasher.sh"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/lib/rdk/imageFlasher.sh")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
| std::ofstream script("/lib/rdk/imageFlasher.sh"); | ||
| script << "#!/bin/sh\nexit 0\n"; | ||
| } | ||
| chmod("/lib/rdk/imageFlasher.sh", 0755); |
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.
Coverity Issue - Unchecked return value from library
Calling "chmod("/lib/rdk/imageFlasher.sh", 493U)" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
|
|
||
| /* Test: flashImage failure with maintenance mode true for mediaclient */ | ||
| TEST_F(FirmwareUpdateTest, UpdateFirmware_FlashImage_Failure_MaintenanceMode_MediaClient) { | ||
| system("mkdir -p /lib/rdk /opt"); |
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.
Coverity Issue - Unchecked return value
Calling "system" without checking return value (as is done elsewhere 3 out of 3 times).
Medium Impact, CWE-252
CHECKED_RETURN
| std::ofstream script("/lib/rdk/imageFlasher.sh"); | ||
| script << "#!/bin/sh\nexit 2\n"; | ||
| } | ||
| chmod("/lib/rdk/imageFlasher.sh", 0755); |
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.
Coverity Issue - Unchecked return value from library
Calling "chmod("/lib/rdk/imageFlasher.sh", 493U)" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
|
|
||
| /* Test: Notification Register/Unregister around a successful update (event delivery check) */ | ||
| TEST_F(FirmwareUpdateTest, Notification_ReceiveUpdateStateChange) { | ||
| system("mkdir -p /lib/rdk"); |
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.
Coverity Issue - Unchecked return value
Calling "system" without checking return value (as is done elsewhere 3 out of 3 times).
Medium Impact, CWE-252
CHECKED_RETURN
| state == "VALIDATION_COMPLETE"); | ||
| } | ||
|
|
||
| std::remove("/etc/device.properties"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/etc/device.properties")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
| } | ||
|
|
||
| std::remove("/etc/device.properties"); | ||
| std::remove("/lib/rdk/imageFlasher.sh"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/lib/rdk/imageFlasher.sh")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
Coverity Issue - Unchecked return value from libraryCalling "remove("/etc/device.properties")" without checking return value. This library function may fail and return an error code. Medium Impact, CWE-252 Issue locationThis issue was discovered outside the diff for this Pull Request. You can find it at: |
Coverity Issue - Unchecked return value from libraryCalling "remove("/lib/rdk/imageFlasher.sh")" without checking return value. This library function may fail and return an error code. Medium Impact, CWE-252 Issue locationThis issue was discovered outside the diff for this Pull Request. You can find it at: |
|
|
||
| /* Test: UpdateFirmware Request Validation - MediaClient Device Type Detected */ | ||
| TEST_F(FirmwareUpdateTest, UpdateFirmware_MediaClient_DeviceTypeCheck) { | ||
| system("mkdir -p /lib/rdk"); |
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.
Coverity Issue - Unchecked return value
Calling "system" without checking return value (as is done elsewhere 3 out of 3 times).
Medium Impact, CWE-252
CHECKED_RETURN
| std::ofstream script("/lib/rdk/imageFlasher.sh"); | ||
| script << "#!/bin/sh\nexit 0\n"; | ||
| } | ||
| chmod("/lib/rdk/imageFlasher.sh", 0755); |
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.
Coverity Issue - Unchecked return value from library
Calling "chmod("/lib/rdk/imageFlasher.sh", 493U)" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
| // Wait long enough for thread to fully complete | ||
| std::this_thread::sleep_for(std::chrono::milliseconds(3000)); | ||
|
|
||
| std::remove("/etc/device.properties"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/etc/device.properties")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
| std::this_thread::sleep_for(std::chrono::milliseconds(3000)); | ||
|
|
||
| std::remove("/etc/device.properties"); | ||
| std::remove("/lib/rdk/imageFlasher.sh"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/lib/rdk/imageFlasher.sh")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
| std::ofstream script("/lib/rdk/imageFlasher.sh"); | ||
| script << "#!/bin/sh\nexit 0\n"; | ||
| } | ||
| chmod("/lib/rdk/imageFlasher.sh", 0755); |
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.
Coverity Issue - Unchecked return value from library
Calling "chmod("/lib/rdk/imageFlasher.sh", 493U)" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
|
|
||
| /* Test: flashImage failure with maintenance mode true for mediaclient */ | ||
| TEST_F(FirmwareUpdateTest, UpdateFirmware_FlashImage_Failure_MaintenanceMode_MediaClient) { | ||
| system("mkdir -p /lib/rdk /opt"); |
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.
Coverity Issue - Unchecked return value
Calling "system" without checking return value (as is done elsewhere 3 out of 3 times).
Medium Impact, CWE-252
CHECKED_RETURN
| std::ofstream script("/lib/rdk/imageFlasher.sh"); | ||
| script << "#!/bin/sh\nexit 2\n"; | ||
| } | ||
| chmod("/lib/rdk/imageFlasher.sh", 0755); |
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.
Coverity Issue - Unchecked return value from library
Calling "chmod("/lib/rdk/imageFlasher.sh", 493U)" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
|
|
||
| /* Test: Notification Register/Unregister around a successful update (event delivery check) */ | ||
| TEST_F(FirmwareUpdateTest, Notification_ReceiveUpdateStateChange) { | ||
| system("mkdir -p /lib/rdk"); |
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.
Coverity Issue - Unchecked return value
Calling "system" without checking return value (as is done elsewhere 3 out of 3 times).
Medium Impact, CWE-252
CHECKED_RETURN
| // For non-mediaclient, file should remain after successful flash | ||
| EXPECT_EQ(0, access(TEST_FIRMWARE_PATH.c_str(), F_OK)); | ||
|
|
||
| std::remove("/etc/device.properties"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/etc/device.properties")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
| EXPECT_EQ(0, access(TEST_FIRMWARE_PATH.c_str(), F_OK)); | ||
|
|
||
| std::remove("/etc/device.properties"); | ||
| std::remove("/lib/rdk/imageFlasher.sh"); |
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.
Coverity Issue - Unchecked return value from library
Calling "remove("/lib/rdk/imageFlasher.sh")" without checking return value. This library function may fail and return an error code.
Medium Impact, CWE-252
CHECKED_RETURN
No description provided.