-
Notifications
You must be signed in to change notification settings - Fork 164
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
Showing
54 changed files
with
19,949 additions
and
110 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.