Skip to content

Commit c945517

Browse files
committed
Fix empty auth
1 parent f4c1f39 commit c945517

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

test/windows/WSLCTests.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,18 +595,25 @@ class WSLCTests
595595

596596
WSLC_TEST_METHOD(PushImage)
597597
{
598+
auto emptyAuth = BuildRegistryAuthHeader("", "", "");
599+
598600
// Validate that pushing a non-existent image fails.
601+
{
602+
VERIFY_ARE_EQUAL(m_defaultSession->PushImage("does-not-exist:latest", emptyAuth.c_str(), nullptr), E_FAIL);
603+
ValidateCOMErrorMessage(L"An image does not exist locally with the tag: does-not-exist");
604+
}
605+
606+
// Validate passing empty auth string returns an appropriate error.
599607
{
600608
VERIFY_ARE_EQUAL(m_defaultSession->PushImage("does-not-exist:latest", "", nullptr), E_INVALIDARG);
601609
}
602610

603611
// Validate that PushImage() returns the appropriate error if the session is terminated.
604612
{
605613
VERIFY_SUCCEEDED(m_defaultSession->Terminate());
606-
607614
auto cleanup = wil::scope_exit([&]() { ResetTestSession(); });
608615

609-
VERIFY_ARE_EQUAL(m_defaultSession->PushImage("hello-world:latest", "", nullptr), HRESULT_FROM_WIN32(ERROR_INVALID_STATE));
616+
VERIFY_ARE_EQUAL(m_defaultSession->PushImage("hello-world:latest", emptyAuth.c_str(), nullptr), HRESULT_FROM_WIN32(ERROR_INVALID_STATE));
610617
}
611618
}
612619

0 commit comments

Comments
 (0)