diff options
| author | klaar36 <klas.arvidsson@liu.se> | 2016-05-16 19:51:18 +0200 |
|---|---|---|
| committer | klaar36 <klas.arvidsson@liu.se> | 2016-05-16 19:51:18 +0200 |
| commit | 3757af98040e80af075e10417179d1a82199d7cf (patch) | |
| tree | 5417b3a873c6c6a844d5f15d462be499e5906cd3 /src | |
| parent | dedf9c50520d7be64d11ae13b957c93fd4a3ee0e (diff) | |
| download | pintos-rs-3757af98040e80af075e10417179d1a82199d7cf.tar.gz | |
explanatory comment and oredering of cases
Diffstat (limited to 'src')
| -rw-r--r-- | src/tests/userprog/exec-missing.ck | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/tests/userprog/exec-missing.ck b/src/tests/userprog/exec-missing.ck index 7f9b0cb..749db01 100644 --- a/src/tests/userprog/exec-missing.ck +++ b/src/tests/userprog/exec-missing.ck @@ -1,15 +1,36 @@ # -*- perl -*- + +# In this test a program named "exec-missing" tries to start another +# program that do not exist. This is discovered in the thread of the +# new program, in the function load. + +# Correct handling can be done in three basic ways: + +# 1. We only know about the failure when our "exec" system call +# returns -1. The "no-such-file" thread never becomes a process and +# do not leave any messages. + +# 2. We know about the failure both when "exec" return -1 and when the +# "no-such-file" thread fails to become a process. It notify the +# failure by printing "load: no-such-file: open failed". But it +# does not become a process and will thus not leave a +# "no-such-file: exit(-1)" message. + +# 3. "exec" return -1 and "no-such-file" become a failed process. It +# will thus produce a "no-such-file: exit(-1)" message. This +# message may occur some time after "open failed". + use strict; use warnings; use tests::tests; check_expected ([<<'EOF', <<'EOF', <<'EOF', <<'EOF', <<'EOF', <<'EOF']); (exec-missing) begin -load: no-such-file: open failed (exec-missing) exec("no-such-file"): -1 (exec-missing) end exec-missing: exit(0) EOF (exec-missing) begin +load: no-such-file: open failed (exec-missing) exec("no-such-file"): -1 (exec-missing) end exec-missing: exit(0) |
