Say the terminal explicitly, only from a login session, and name the unannounced pull request (hq ADR 0272)
- commandEnvironment takes the terminal as a bool instead of reading an empty verb as one; every non-terminal line names its verb and is stripped of MESH_CLI_TERMINAL, and a test with the mark set in the serving environment fails when that strip is taken out. - On the control-node the operator's account is the terminal only from a login session, as the node-engine reads it from the kernel's cgroup; the tool runner and the account's user units run as the operator too, and are ordinary calls. The request carries `session` (field-name tests on both sides). - A pull request the forge never announced is named with its number in the condition's headline (hq issue 347), from the stalled line's `number`, which mesh-delivery sends.
This commit is contained in:
@@ -37,6 +37,10 @@ type CLIAsked struct {
|
||||
Account string `json:"account"`
|
||||
UID uint32 `json:"uid"`
|
||||
Follow string `json:"follow,omitempty"`
|
||||
// Session is the login session the asking process runs in, as the node-engine read it from the kernel's cgroup
|
||||
// (`session-<id>.scope` under the account's own slice), or empty: a service, a user unit. Only a login session is
|
||||
// the terminal (novox/hq ADR 0272).
|
||||
Session string `json:"session,omitempty"`
|
||||
}
|
||||
|
||||
// CLIAnswer is what the controller answers, as the `result` of a call's answer: what the command printed, how it
|
||||
|
||||
@@ -17,7 +17,11 @@ import (
|
||||
// The node-engine's request and the answer it hands mesh-cli hold these field names; the engine's side holds the
|
||||
// same list (mesh-host internal/meshcli, TestTheRequestToTheControllerKeepsItsFieldNames).
|
||||
func TestTheMeshCLIRequestAndAnswerKeepTheirFieldNames(t *testing.T) {
|
||||
body, _ := json.Marshal(CLIAsked{Line: []string{"status"}, Account: "a", UID: 1})
|
||||
body, _ := json.Marshal(CLIAsked{Line: []string{"status"}, Account: "a", UID: 1, Session: "session-3.scope"})
|
||||
if got := keysIn(t, body); got != "account line session uid" {
|
||||
t.Fatalf("the request's fields are %q", got)
|
||||
}
|
||||
body, _ = json.Marshal(CLIAsked{Line: []string{"status"}, Account: "a", UID: 1})
|
||||
if got := keysIn(t, body); got != "account line uid" {
|
||||
t.Fatalf("the request's fields are %q", got)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user