Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
flux-start: add embedded server for testing
Problem: tests that involve starting and stopping brokers are difficult to orchestrate using flux-start, but we will need support for running such tests in CI. Use the new usock_service to embed a server in flux-start. The server creates a socket named 'start' in the rundir, so a client just needs to make a substitution to the value of FLUX_URI to be able to connect. Currently the server has support for the following methods: start.status Return an array of procs that includes broker PIDs in rank order disconnect Log receipt of disconnect message. This is a placeholder for future streaming socket management. Add a test front end command that provides the client side for the start.status RPC, and is available to add sub-commands for simple, shell script driven testing. More sophisticated, event driven test programs would be written in python and combine broker and flux-start communication. Add a few tests to t0001-basic.t to exercise basic function.
- Loading branch information
Showing
4 changed files
with
142 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
############################################################### | ||
# Copyright 2021 Lawrence Livermore National Security, LLC | ||
# (c.f. AUTHORS, NOTICE.LLNS, COPYING) | ||
# | ||
# This file is part of the Flux resource manager framework. | ||
# For details, see https://github.com/flux-framework. | ||
# | ||
# SPDX-License-Identifier: LGPL-3.0 | ||
############################################################### | ||
|
||
# startctl - tell flux-start to do things | ||
# | ||
# Usage: flux start -s1 flux python startctl.py | ||
|
||
import sys | ||
import os | ||
import flux | ||
|
||
|
||
def status(h): | ||
print(h.rpc("start.status").get_str()) | ||
|
||
|
||
def main(): | ||
uri = os.environ.get("FLUX_URI").replace("local-0", "start") | ||
h = flux.Flux(uri) | ||
status(h) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() | ||
|
||
|
||
# vi: ts=4 sw=4 expandtab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters