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

minor fix after zboxcli change(s) #592

Merged
merged 3 commits into from
Mar 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 3 additions & 19 deletions tests/cli_tests/zboxcli_share_file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func TestShareFile(testSetup *testing.T) {
require.Contains(t, output[1], filepath.Base(file))
})

t.RunWithTimeout("Shared encrypted file to public using auth ticket should fail to download", 60*time.Second, func(t *test.SystemTest) {
t.RunWithTimeout("Shared encrypted file to public using auth ticket without encryptionkey flag should fail", 60*time.Second, func(t *test.SystemTest) {
walletOwner := escapedTestName(t)
allocationID, _ := registerAndCreateAllocation(t, configPath, walletOwner)

Expand Down Expand Up @@ -217,25 +217,9 @@ func TestShareFile(testSetup *testing.T) {
"remotepath": file,
}
output, err = shareFile(t, configPath, shareParams)
require.Nil(t, err, strings.Join(output, "\n"))
require.Len(t, output, 1, "share file - Unexpected output", strings.Join(output, "\n"))

authTicket, err := extractAuthToken(output[0])
require.Nil(t, err, "Error extracting auth token")
require.NotEqual(t, "", authTicket)

// Download the file (delete local copy first)
os.Remove(file)

downloadParams := createParams(map[string]interface{}{
"localpath": file,
"authticket": authTicket,
})
output, err = downloadFileForWallet(t, receiverWallet, configPath, downloadParams, false)
require.NotNil(t, err, strings.Join(output, "\n"))
require.Len(t, output, 3, "download file - Unexpected output", strings.Join(output, "\n"))
aggregatedOutput := strings.ToLower(strings.Join(output, " "))
require.Contains(t, aggregatedOutput, "invalid ed25519 curve point")
require.Equal(t, "Clientid and/or encryptionpublickey are missing for the encrypted share!", output[0], "An unexpected error message!")
require.Len(t, output, 1, "share file - Unexpected output", strings.Join(output, "\n"))
})

t.RunWithTimeout("Revoke auth ticket on publicly-shared unencrypted file should fail to download", 60*time.Second, func(t *test.SystemTest) {
Expand Down