Skip to content

Commit

Permalink
fix(resetter/shell): cleanup properly in the event of the remote srv …
Browse files Browse the repository at this point in the history
…being unreachable

Signed-off-by: Pierre Fenoll <[email protected]>
  • Loading branch information
fenollp committed Oct 6, 2024
1 parent 5afe1e5 commit 94194ec
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ debug: SHELL = /bin/bash -o pipefail
debug: all
./$(EXE) lint
./$(EXE) fuzz --seed=fm_AdrZpxEHTjUJMuZEfKq5tYqngxgFi5EQPNGeFzYnwbjexR8jdfir7pYX82 ; [[ $$? = 6 ]]
# ./$(EXE) fuzz --exclude-tags=failing --progress=bar
./$(EXE) fuzz --exclude-tags=failing --progress=ci
./$(EXE) fuzz --exclude-tags=failing --progress=ci #=bar

distclean: clean
$(if $(wildcard dist/),rm -r dist/)
Expand Down
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,3 @@ Report bugs [on the project page](https://github.com/FuzzyMonkeyCo/monkey/issues
## License

See [LICENSE](./LICENSE)


https://github.com/google/fuzzing/blob/master/docs/structure-aware-fuzzing.md#fuzzing-stateful-apis

https://github.com/google/fuzztest
8 changes: 5 additions & 3 deletions pkg/resetter/shell/singleton.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ var (
)

func (s *Resetter) signal(verb, param string) {
io.WriteString(s.stdin, verb)
io.WriteString(s.stdin, param)
io.WriteString(s.stdin, "\n")
if s.stdin != nil { // Is `nil` if it never started (e.g. remote is unreachable)
io.WriteString(s.stdin, verb)
io.WriteString(s.stdin, param)
io.WriteString(s.stdin, "\n")
}
}

func writeMainScript(name string, paths []string) (err error) {
Expand Down

0 comments on commit 94194ec

Please sign in to comment.