-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
devUpload should not be parsed by egde-view
Since keepSentQueue contains the same or more logs than devUpload, it's enough to only use those logs when searching with edge-view. Signed-off-by: Paul Gaiduk <paulg@zededa.com>
- Loading branch information
1 parent
4bb28ac
commit 2edd016
Showing
148 changed files
with
178,518 additions
and
1,728 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (c) 2024 Zededa, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package main | ||
|
||
import ( | ||
"path" | ||
"testing" | ||
"time" | ||
|
||
. "github.com/onsi/gomega" | ||
) | ||
|
||
func TestWalkLogDirs(t *testing.T) { | ||
g := NewWithT(t) | ||
|
||
// test the walkLogDirs function | ||
newlogDir = "../../newlog/testdata" | ||
|
||
const layout = "2006-01-02 15:04:05.000 -0700 MST" | ||
timestamp := "2024-11-13 10:58:52.618 +0100 CET" | ||
parsedTime, err := time.Parse(layout, timestamp) | ||
g.Expect(err).NotTo(HaveOccurred(), "failed to parse timestamp") | ||
|
||
from := parsedTime.Add(-1 * time.Second) | ||
to := parsedTime.Add(1 * time.Second) | ||
foundFiles := walkLogDirs(to.Unix(), from.Unix()) | ||
g.Expect(foundFiles).To(HaveLen(1), "expected exactly one file to be found") | ||
|
||
expected := logfiletime{ | ||
filepath: path.Join(newlogDir, "keepSentQueue/dev.log.keep.1731491932618.gz"), | ||
filesec: 1731491932, | ||
} | ||
g.Expect(foundFiles[0]).To(Equal(expected)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.