Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pomo-mondreganto committed Nov 17, 2023
1 parent 18dbe92 commit 98745f7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/server/exploits/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/google/uuid"
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/testing/protocmp"
"google.golang.org/protobuf/types/known/durationpb"

"github.com/c4t-but-s4d/neo/v2/internal/server/config"
"github.com/c4t-but-s4d/neo/v2/pkg/hostbucket"
Expand Down Expand Up @@ -40,6 +41,8 @@ func TestServer_UpdateExploit(t *testing.T) {
cfg := &epb.ExploitConfiguration{
Entrypoint: "bin",
IsArchive: false,
Timeout: durationpb.New(time.Minute),
RunEvery: durationpb.New(time.Minute),
}
r := &epb.UpdateExploitRequest{
State: &epb.ExploitState{
Expand All @@ -50,6 +53,9 @@ func TestServer_UpdateExploit(t *testing.T) {
}
resp, err := es.UpdateExploit(context.Background(), r)
require.NoError(t, err)

cfg.Timeout = durationpb.New(2 * time.Minute)
cfg.RunEvery = durationpb.New(2 * time.Minute)
want := &epb.ExploitState{
ExploitId: "1",
Version: 1,
Expand All @@ -67,6 +73,8 @@ func TestServer_Exploit(t *testing.T) {
cfg := &epb.ExploitConfiguration{
Entrypoint: "bin",
IsArchive: false,
Timeout: durationpb.New(time.Minute),
RunEvery: durationpb.New(time.Minute),
}
state := &epb.ExploitState{
ExploitId: "1",
Expand Down Expand Up @@ -99,6 +107,8 @@ func TestServer_Ping(t *testing.T) {
cfg := &epb.ExploitConfiguration{
Entrypoint: "bin",
IsArchive: false,
Timeout: durationpb.New(time.Minute),
RunEvery: durationpb.New(time.Minute),
}
state := &epb.ExploitState{
ExploitId: "1",
Expand Down

0 comments on commit 98745f7

Please sign in to comment.