Skip to content
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

Remove HTTP from supported protocols in Downloader #42

Conversation

OleksandrChaika
Copy link
Contributor

No description provided.

Copy link
Contributor

@OlavHerbst OlavHerbst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, wrote just a suggestion

Req. says "download is rejected by SUA and feedback is written to log "
Missing log output.

@@ -409,4 +411,21 @@ namespace {
EXPECT_EQ(sentMessages, expectedMessages);
}

TEST_F(TestSelfUpdateScenarios, downloadFromHTTPFails_endsInFailedState)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename test like "downloadViaHttpConnectionFails_endsInFailedState"
(in CamelCase names contained acronyms should be written in lowercase to be able to better separate the words while reading)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@@ -409,4 +411,21 @@ namespace {
EXPECT_EQ(sentMessages, expectedMessages);
}

TEST_F(TestSelfUpdateScenarios, downloadFromHTTPFails_endsInFailedState)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing TCs for other protocols to be also failing, at least ftp, sftp, smb, smbs, ldap, ldaps
Ok, the task says only "Configure libcurl to not use HTTP protocol", but curl config rejects all protocols now except https. So more protocols should also be tested? (Can't be complete.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added parameterized test case

Copy link
Contributor

@OlavHerbst OlavHerbst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing test case for "http"

return sua::TechCode::DownloadFailed;
auto e = curl_easy_strerror(res);
sua::Logger::error(e);
return std::make_tuple(sua::TechCode::DownloadFailed, "");
Copy link
Contributor

@OlavHerbst OlavHerbst Jul 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would add "Errorcode = ...", to get later not an error message with only "Download failed:"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added error to 2nd value in tuple

TestDownloaderViaUnsupportedProtocols,
TestDownloaderP,
::testing::Values(
"ftp", "sftp", "smb", "smbs", "ldap", "ldaps"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing "http"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Contributor

@OlavHerbst OlavHerbst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 findings

Copy link
Contributor

@OlavHerbst OlavHerbst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@OleksandrChaika OleksandrChaika force-pushed the fix/download_only_from_https branch 6 times, most recently from d933ac6 to ce8da69 Compare July 28, 2023 12:05
@OleksandrChaika OleksandrChaika force-pushed the fix/download_only_from_https branch 4 times, most recently from 5f4405a to 36220fc Compare July 28, 2023 21:17
@OleksandrChaika OleksandrChaika force-pushed the fix/download_only_from_https branch 3 times, most recently from ed5df88 to 384d418 Compare July 29, 2023 07:40
Copy link
Contributor

@OlavHerbst OlavHerbst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@OleksandrChaika OleksandrChaika merged commit a4382ff into eclipse-leda:main Jul 31, 2023
7 checks passed
@OleksandrChaika OleksandrChaika deleted the fix/download_only_from_https branch July 31, 2023 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants