mirror of https://github.com/chaos-mesh/chaosd.git
add default value of PayloadProcessNum&FillByFAllocate (#121)
* add default value of PayloadProcessNum&FillByFAllocate Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * recover unit-test Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * recover unit-test Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
This commit is contained in:
parent
7103539ffe
commit
22a8a7cfc9
|
|
@ -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
|
||||
|
|
|
|||
2
Makefile
2
Makefile
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -85,6 +85,8 @@ func NewDiskOption() *DiskOption {
|
|||
CommonAttackConfig: CommonAttackConfig{
|
||||
Kind: DiskAttack,
|
||||
},
|
||||
PayloadProcessNum: 1,
|
||||
FillByFAllocate: true,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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{
|
||||
|
|
|
|||
|
|
@ -80,10 +80,6 @@ func TestSplitByteSize(t *testing.T) {
|
|||
BlockSize: "1M",
|
||||
Count: "0",
|
||||
},
|
||||
{
|
||||
BlockSize: "",
|
||||
Count: "",
|
||||
},
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
|
|
@ -109,8 +105,8 @@ func TestSplitByteSize(t *testing.T) {
|
|||
BlockSize: "524288c",
|
||||
Count: "1",
|
||||
}, {
|
||||
BlockSize: "1",
|
||||
Count: "0c",
|
||||
BlockSize: "1M",
|
||||
Count: "0",
|
||||
}},
|
||||
wantErr: false,
|
||||
}, {
|
||||
|
|
@ -126,8 +122,8 @@ func TestSplitByteSize(t *testing.T) {
|
|||
BlockSize: "524288c",
|
||||
Count: "1",
|
||||
}, {
|
||||
BlockSize: "1",
|
||||
Count: "1c",
|
||||
BlockSize: "1c",
|
||||
Count: "1",
|
||||
}},
|
||||
wantErr: false,
|
||||
}, {
|
||||
|
|
@ -143,8 +139,8 @@ func TestSplitByteSize(t *testing.T) {
|
|||
BlockSize: "1M",
|
||||
Count: "2",
|
||||
}, {
|
||||
BlockSize: "1",
|
||||
Count: "1048576c",
|
||||
BlockSize: "1048576c",
|
||||
Count: "1",
|
||||
}},
|
||||
wantErr: false,
|
||||
}, {
|
||||
|
|
@ -160,8 +156,8 @@ func TestSplitByteSize(t *testing.T) {
|
|||
BlockSize: "1M",
|
||||
Count: "2",
|
||||
}, {
|
||||
BlockSize: "1",
|
||||
Count: "1048577c",
|
||||
BlockSize: "1048577c",
|
||||
Count: "1",
|
||||
}},
|
||||
wantErr: false,
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue