Skip to content

page-parallel <test> #18

@SangChunn

Description

@SangChunn
/* Runs 4 child-linear processes at once. */

#include <syscall.h>
#include "tests/lib.h"
#include "tests/main.h"

#define CHILD_CNT 4

void
test_main (void)
{
  pid_t children[CHILD_CNT];
  int i;

  for (i = 0; i < CHILD_CNT; i++) {
    children[i] = fork ("child-linear");
    if (children[i] == 0) {
      if (exec ("child-linear") == -1)
        fail ("failed to exec child-linear");
    }
  }
  for (i = 0; i < CHILD_CNT; i++) {
    CHECK (wait (children[i]) == 0x42, "wait for child %d", i);
  }
}
  1. fork()가 정상적으로 새로운 프로세스를 생성하는지
  2. fork 후 자식이 exec()로 새로운 프로그램을 실행하는지
  3. 부모가 여러 자식을 동시에 wait()할 수 있는지
  4. 각 자식 프로세스가 exit(0x42) 값을 정상적으로 전달하는지
  5. 프로세스 테이블, 자식 관리, 메모리 복사, 파일 디스크립터 복제 등이 모두 올바른지

즉, 멀티-process 환경에서 Pintos의 userprog 구현이 제대로 동작하는지 확인하는 테스트

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Test

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions