File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -1022,6 +1022,33 @@ func TestExecParse(t *testing.T) {
10221022 assert .Equal (t , string (cwd ), decCwd )
10231023 })
10241024
1025+ t .Run ("7" , func (t * testing.T ) {
1026+ observer .DataPurge ()
1027+
1028+ // - filename (string)
1029+ // - no args
1030+ // - no cwd
1031+
1032+ exec .Flags = 0
1033+ exec .Size = uint32 (processapi .MSG_SIZEOF_EXECVE + len (filename ))
1034+
1035+ var buf bytes.Buffer
1036+ binary .Write (& buf , binary .LittleEndian , exec )
1037+ binary .Write (& buf , binary .LittleEndian , filename )
1038+
1039+ reader := bytes .NewReader (buf .Bytes ())
1040+
1041+ process , err := execParse (reader )
1042+ require .NoError (t , err )
1043+
1044+ assert .Equal (t , string (filename ), process .Filename )
1045+ assert .Empty (t , process .Args )
1046+
1047+ decArgs , decCwd := proc .ArgsDecoder (process .Args , process .Flags )
1048+ assert .Empty (t , decArgs )
1049+ assert .Empty (t , decCwd )
1050+ })
1051+
10251052 observer .DataPurge ()
10261053}
10271054
You can’t perform that action at this time.
0 commit comments