Skip to content

Conversation

@razvand
Copy link

@razvand razvand commented May 15, 2021

Assignment testing is done automatically via vmchecker. This is done
with the help of the so2-startup-script placed in /etc/init.d/so2
and then symlinked in /etc/rcX.d/99so2 (X = 1..6).

For networking assignments (i.e. the STP - Simple Transport Protocol),
two issues prevent proper testing:

  1. Because there is no terminal, standard file descriptors (0, 1, 2) are
    not initialized. If no redirection is used, then these file descriptors
    (0, for example) will be used for socket descriptors. Tests for socket()
    calls assume returned socket file descriptors are > 0. This is fixed by
    redirecting standard input from /dev/null, thus initializing the
    standard input file descriptor (0).

  2. The loopback interface is not initialized. Tests using send/receive
    calls fails. This is fixed by enabling the loopback interface (lo).

Issue 1 could be fixed by updating the test and not redirecting input from /dev/null. What do you think is the best way to handle this?

…gnments

Assignment testing is done automatically via vmchecker. This is done
with the help of the `so2-startup-script` placed in `/etc/init.d/so2`
and then symlinked in `/etc/rcX.d/99so2` (X = 1..6).

For networking assignments (i.e. the STP - Simple Transport Protocol),
two issues prevent proper testing:

1. Because there is no terminal, standard file descriptors (0, 1, 2) are
not initialized. If no redirection is used, then these file descriptors
(0, for example) will be used for socket descriptors. Tests for socket()
calls assume returned socket file descriptors are > 0. This is fixed by
redirecting standard input from `/dev/null`, thus initializing the
standard input file descriptor (0).

2. The loopback interface is not initialized. Tests using send/receive
calls fails. This is fixed by enabling the loopback interface (`lo`).

Signed-off-by: Razvan Deaconescu <[email protected]>
@razvand razvand added assignments Kernel programming Assignments infrastructure Infrastructure for building and testing labels May 15, 2021
@razvand razvand requested review from consra and sergiu121 May 15, 2021 05:42
@razvand razvand self-assigned this May 15, 2021
@lkt-bot
Copy link
Collaborator

lkt-bot commented May 15, 2021

Copy link

@consra consra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The solution for problem 1 seems fine for me. All good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

assignments Kernel programming Assignments infrastructure Infrastructure for building and testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants