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

AWSCredentialsProviderTest Tests Failing on armv7l build #2672

Closed
mike6789 opened this issue Sep 17, 2023 · 10 comments · Fixed by #2983
Closed

AWSCredentialsProviderTest Tests Failing on armv7l build #2672

mike6789 opened this issue Sep 17, 2023 · 10 comments · Fixed by #2983
Labels
bug This issue is a bug. p3 This is a minor priority issue pending-release This issue will be fixed by an approved PR that hasn't been released yet.

Comments

@mike6789
Copy link

Describe the bug

Build does not complete on armv7l target with Ubuntu OS.

'''
[100%] Linking CXX executable aws-cpp-sdk-core-tests
/root/aws-sdk-cpp/tests/aws-cpp-sdk-core-tests/aws/auth/AWSCredentialsProviderTest.cpp:343: Failure
Expected equality of these values:
"goodAccessKey"
provider.GetAWSCredentials().GetAWSAccessKeyId()
Which is: ""
[ FAILED ] InstanceProfileCredentialsProviderTest.TestThatProviderRefreshes (2 ms)
/root/aws-sdk-cpp/tests/aws-cpp-sdk-core-tests/aws/auth/AWSCredentialsProviderTest.cpp:361: Failure
Expected equality of these values:
"goodAccessKey"
provider.GetAWSCredentials().GetAWSAccessKeyId()
Which is: ""
[ FAILED ] InstanceProfileCredentialsProviderTest.TestCredentialsDontRefreshForCredentialsInPast (1 ms)
/root/aws-sdk-cpp/tests/aws-cpp-sdk-core-tests/aws/auth/AWSCredentialsProviderTest.cpp:330: Failure
Expected equality of these values:
"goodAccessKey"
provider.GetAWSCredentials().GetAWSAccessKeyId()
Which is: ""
'''

Expected Behavior

Build should complete

Current Behavior

Test error out

Reproduction Steps

Simply follow the guide here -> https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/setup-linux.html

I am running this on an Orange Pi Zero board

Possible Solution

No response

Additional Information/Context

No response

AWS CPP SDK version used

main

Compiler and Version used

-- The C compiler identification is GNU 11.4.0

Operating System and version

VERSION="22.04.3 LTS (Jammy Jellyfish)"

@mike6789 mike6789 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 17, 2023
@yasminetalby yasminetalby self-assigned this Sep 18, 2023
@yasminetalby yasminetalby added investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. labels Sep 18, 2023
@yasminetalby
Copy link
Contributor

Hello @mike6789 ,

Thank you very much for your submission.

Based on the behavior you are experiencing:

Expected equality of these values:
"goodAccessKey"
provider.GetAWSCredentials().GetAWSAccessKeyId()
Which is: ""

as you can see in the AWSCredentialsProviderTest.cpp test file, it seems that when testing the InstanceProfileCredentialsProvider, the mockClient credentials value are not being set.

How are you providing your AWSCredentials? While looking into this, a workaround could be to disable the tests. You can do this with -DENABLE_TESTING=OFF

Best regards,

Yasmine

@yasminetalby yasminetalby added p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. labels Sep 18, 2023
@mike6789
Copy link
Author

Hi @yasminetalby ,

I actually did not provide the credentials yet, I thought this test is some kind of self-contained test with pseudo credentials. Will providing the credentials fix the test? I did disable the tests for now and was able to build.

Can you suggest a way to provide the credentials? I would like to simply make a file (such as ~/.aws/credentials) that holds my key, will the SDK pick this up or do I need to explicitly point it to this file (and how can I do that if so)?

Thank you!!

@yasminetalby
Copy link
Contributor

yasminetalby commented Sep 18, 2023

Hello @mike6789 ,

Thank you very much for your fast response. I am glad the workaround allowed you to build the SDK. Providing your credentials will not fix the test, I wanted to check which credential provider you would like to use with the sdk.

There are multiple ways to provide the credentials to authenticate described in our developer guide (see). What you are looking for is actually documented here.

By default, the sdk will follow the default credential provider chain to retrieve credentials.

You can choose whatever option you prefer to provide credentials. If you are planning to use the shared AWS config and credentials files, the[default] profile credential values will be used by an SDK or tool operation by default if a specific named profile is not specified.

Let me know if that helps or if you need further guidance/have any questions!

Best regards,

Yasmine

@yasminetalby yasminetalby added p3 This is a minor priority issue and removed p2 This is a standard priority issue labels Sep 18, 2023
@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. label Sep 19, 2023
@yasminetalby yasminetalby added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Oct 2, 2023
@github-actions
Copy link

github-actions bot commented Oct 3, 2023

Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Oct 3, 2023
@github-actions github-actions bot closed this as completed Oct 8, 2023
@asfg84
Copy link

asfg84 commented Oct 20, 2023

I ran into the same issue and do not want to disable all tests to get the SDK built. Is there any way these tests can be fixed?

@flixr
Copy link
Contributor

flixr commented Oct 20, 2023

@yasminetalby can we please reopen this?
We have the same problem. The tests are selfcontained and the credentials should be injected via mock.
Works fine e.g. on amd64 and arm64, but as @mike6789 pointed out, this fails on armhf (armv7l).
Disabling all tests is not really a good solution.

@asfg84
Copy link

asfg84 commented May 29, 2024

@yasminetalby the problem still persists with the current main. Could you please reopen this issue? We do not want to disable the tests.

@jmklix jmklix reopened this May 29, 2024
@jmklix jmklix removed response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. closed-for-staleness labels May 29, 2024
@asfg84
Copy link

asfg84 commented May 31, 2024

The problem is in the test itself, when the "Expiration" date is set to the year 2047, which causes an overflow on armhf being a 32bit architecture: e.g. https://github.com/aws/aws-sdk-cpp/blob/main/tests/aws-cpp-sdk-core-tests/aws/auth/AWSCredentialsProviderTest.cpp#L302
Thus, the credentials are reported as expired.

Changing the expiration date to the year 2037 fixes the issue (see also "Year 2038 Problem")

@jmklix
Copy link
Member

jmklix commented May 31, 2024

Thanks for pointing this out. Testing your suggested change before merging the PR
#2983

@jmklix jmklix added the pending-release This issue will be fixed by an approved PR that hasn't been released yet. label May 31, 2024
@jmklix jmklix linked a pull request May 31, 2024 that will close this issue
11 tasks
Copy link

github-actions bot commented Jun 3, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p3 This is a minor priority issue pending-release This issue will be fixed by an approved PR that hasn't been released yet.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants