Skip to content

Commit

Permalink
libs/go/sia/access/tokens: fix dropped test errors (#2423)
Browse files Browse the repository at this point in the history
Signed-off-by: Lars Lehtonen <[email protected]>
  • Loading branch information
alrs authored Nov 21, 2023
1 parent d67cb3f commit c847680
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libs/go/sia/access/tokens/tokens_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ func TestToBeRefreshed(t *testing.T) {
err = os.WriteFile(tpath, token(360, currentUnixTime), 0400)
require.Nilf(t, err, fmt.Sprintf("should be able to create token: %s", tpath))
err = os.Chtimes(tpath, time.Now(), time.Now().Add(-time.Minute*90))
require.NoError(t, err, "error changing os time on file %q: %v", tpath, err)

tpath = filepath.Join(tokenDir, domain, "reader-fail1")
log.Printf("Creating a token at: %s\n", tpath)
Expand Down Expand Up @@ -212,7 +213,7 @@ func TestToBeRefreshedWithStoreOption(t *testing.T) {
err = os.WriteFile(tpath, token(360000, currentUnixTime), 0400)
require.Nilf(t, err, fmt.Sprintf("should be able to create token: %s", tpath))
err = os.Chtimes(tpath, time.Now(), time.Now().Add(-time.Minute*90))

require.NoError(t, err, "error changing os time on file %q: %v", tpath, err)
opts := config.TokenOptions{
TokenDir: tokenDir,
Tokens: tokens,
Expand Down Expand Up @@ -749,6 +750,7 @@ func TestTokenRefreshOption(t *testing.T) {
siaDir := "/tmp"

opts, err := options.NewOptions(cfg, configAccount, nil, siaDir, "1.0.0", false, "us-west-2")
require.NoError(t, err, "error creating new options: %v", err)
tokenOpts, err := NewTokenOptions(opts, ztsServer.baseUrl("zts/v1"), "mock-ua")
require.Nilf(t, err, "error should not be thrown, error: %v", err)
dur, _ := time.ParseDuration(DefaultRefreshDuration)
Expand Down

0 comments on commit c847680

Please sign in to comment.