Skip to content

Commit

Permalink
add default value of PayloadProcessNum&FillByFAllocate (#121)
Browse files Browse the repository at this point in the history
* add default value of PayloadProcessNum&FillByFAllocate

Signed-off-by: andrewmatilde <[email protected]>

* recover unit-test

Signed-off-by: andrewmatilde <[email protected]>

* recover unit-test

Signed-off-by: andrewmatilde <[email protected]>
  • Loading branch information
Andrewmatilde authored Jan 11, 2022
1 parent 7103539 commit 22a8a7c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
elif [[ "$job" == "build" ]]; then
make build
elif [[ "$job" == "unit-test" ]]; then
make test
make unit-test
elif [[ "$job" == "integration-test" ]]; then
sudo apt-get update
sudo apt-get install -y stress-ng
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ tidy:
GO111MODULE=on go mod tidy
git diff -U --exit-code go.mod go.sum

test:
unit-test:
rm -rf cover.* cover
$(GOTEST) $$($(PACKAGE_LIST)) -coverprofile cover.out.tmp
cat cover.out.tmp | grep -v "_generated.deepcopy.go" > cover.out
Expand Down
2 changes: 2 additions & 0 deletions pkg/core/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ func NewDiskOption() *DiskOption {
CommonAttackConfig: CommonAttackConfig{
Kind: DiskAttack,
},
PayloadProcessNum: 1,
FillByFAllocate: true,
}
}

Expand Down
9 changes: 0 additions & 9 deletions pkg/core/disk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,4 @@ func Test_initPath(t *testing.T) {
}
_, err := initPath(&opt)
assert.Error(t, err)

opt = DiskOption{
CommonAttackConfig: CommonAttackConfig{
Action: DiskReadPayloadAction,
},
Path: "/",
}
_, err = initPath(&opt)
assert.NoError(t, err)
}
2 changes: 1 addition & 1 deletion pkg/core/jvm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func TestJVMCommand(t *testing.T) {
Pid: 1234,
Action: JVMStressAction,
},
"must set one of cpu-count and mem-size",
"must set one of cpu-count and mem-type",
},
{
&JVMCommand{
Expand Down
20 changes: 8 additions & 12 deletions pkg/utils/units_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ func TestSplitByteSize(t *testing.T) {
BlockSize: "1M",
Count: "0",
},
{
BlockSize: "",
Count: "",
},
},
wantErr: false,
},
Expand All @@ -109,8 +105,8 @@ func TestSplitByteSize(t *testing.T) {
BlockSize: "524288c",
Count: "1",
}, {
BlockSize: "1",
Count: "0c",
BlockSize: "1M",
Count: "0",
}},
wantErr: false,
}, {
Expand All @@ -126,8 +122,8 @@ func TestSplitByteSize(t *testing.T) {
BlockSize: "524288c",
Count: "1",
}, {
BlockSize: "1",
Count: "1c",
BlockSize: "1c",
Count: "1",
}},
wantErr: false,
}, {
Expand All @@ -143,8 +139,8 @@ func TestSplitByteSize(t *testing.T) {
BlockSize: "1M",
Count: "2",
}, {
BlockSize: "1",
Count: "1048576c",
BlockSize: "1048576c",
Count: "1",
}},
wantErr: false,
}, {
Expand All @@ -160,8 +156,8 @@ func TestSplitByteSize(t *testing.T) {
BlockSize: "1M",
Count: "2",
}, {
BlockSize: "1",
Count: "1048577c",
BlockSize: "1048577c",
Count: "1",
}},
wantErr: false,
},
Expand Down

0 comments on commit 22a8a7c

Please sign in to comment.