Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ngnfs-tests #9

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open

Conversation

valversity
Copy link
Contributor

To support automated testing by the external ngnfs-tests, this adds two commits on top of the clientExit branch:

  1. build a static library for test executables to link against
  2. default to background mode and report success/failure of init

thread_stop_wait() already does a thread_stop_indicate() first thing,
no need to do it twice.

Signed-off-by: Valerie Aurora <[email protected]>
The return code is alreadly negative (-1); setting itself to its
negative made it positive and broke the error handling code which
assumes -ERRNO. Instead set it to -errno.

Signed-off-by: Valerie Aurora <[email protected]>
The send thread of a peer socket may be asleep on a wait queue. Wake
it so that the socket destroy can complete.

Signed-off-by: Valerie Aurora <[email protected]>
end_write_io was clearing the dirty bit on the set, but not the block
itself.

Signed-off-by: Valerie Aurora <[email protected]>
Remove the thread_should_return() check from the outer loop so that we
can't return without fully draining the queue.

Signed-off-by: Valerie Aurora <[email protected]>
ngfns_pfs_read_inode() already destroys the transaction, no need to do
it again.
We are renaming the manifests to maps and preparing for them to be
provided by a server. This is the initial version of the part of the
maps code shared by both kernel and user. Nothing uses it yet.

Signed-off-by: Valerie Aurora <[email protected]>
The mapd server will replace specifying the devd addresses on the command line.

Signed-off-by: Valerie Aurora <[email protected]>
Add an ngnfs-cli subcommand to ask for a map from the mapd server.

Signed-off-by: Valerie Aurora <[email protected]>
Make all of ngnfs use the new maps code instead of the old manifests.

Signed-off-by: Valerie Aurora <[email protected]>
Now that we are using the new maps code everywhere, delete the unused manifest
code.

Signed-off-by: Valerie Aurora <[email protected]>
Add thread_shutdown_all() which sends a SIGUSR1 to the main
supervisory thread, which can then wake its child which is actually
doing ngnfs things with signals off. Allows the program to exit
cleanly for tests.

Signed-off-by: Valerie Aurora <[email protected]>
Add a function to shutdown in-progress ngnfs threads in the event of a
fatal fs-wide error like being unable to connect to the devd or mapd
servers.

Signed-off-by: Valerie Aurora <[email protected]>
If we get any connect() error, shut down the entire file system.

Signed-off-by: Valerie Aurora <[email protected]>
Mount now requests the maps but does not wait for them to arrive
before returning. Unmount now uses ngnfs_shutdown to quiesce work
and wake blocked threads before calling the destroy routines.
Make debugfs exit if connect() fails to the mapd or devd server. At
some point this should be a flag or a timeout, but for now this lets
us write tests.

Signed-off-by: Valerie Aurora <[email protected]>
Now that children can signal parents to quit, add a quit command to
debugfs to exit cleanly.

Signed-off-by: Valerie Aurora <[email protected]>
Build a static library for use by test binaries in ngnfs-tests.

Signed-off-by: Valerie Aurora <[email protected]>
To make testing easier and support running as a SysV style daemon,
make the default mode of the mapd and devd servers be to spawn a
subprocess and signal the status of initialization before going into
sigwait() mode. To prevent this, use the -f/--foreground option.

Signed-off-by: Valerie Aurora <[email protected]>
@valversity valversity force-pushed the val/ngnfsTests branch 2 times, most recently from 05c37bc to 91a7b6b Compare January 8, 2025 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant