feat(dobotai): containerize test runtime and admin bootstrap
This commit is contained in:
@@ -14,4 +14,5 @@ var (
|
||||
ErrAdministratorNotFound = errors.New("administrator not found")
|
||||
ErrLastAdministrator = errors.New("last active administrator cannot be disabled")
|
||||
ErrAdministratorAlreadyDisabled = errors.New("administrator already disabled")
|
||||
ErrBootstrapCandidatePending = errors.New("bootstrap candidate pending")
|
||||
)
|
||||
|
||||
@@ -88,7 +88,7 @@ func (c *Controller) Handle(ctx context.Context, in SettingInput) (string, error
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return "身份已验证,请回到服务器命令行等待确认。", nil
|
||||
return "身份已验证,服务器终端将自动完成管理员绑定。", nil
|
||||
}
|
||||
if explicit && len(args) == 0 {
|
||||
admin, err := c.repo.IsAdministrator(ctx, in.TenantKey, in.StaffID)
|
||||
|
||||
@@ -372,7 +372,7 @@ func TestControllerDetectsBootstrapCandidate(t *testing.T) {
|
||||
if r.candidate.Code != "123456" || r.candidate.StaffID != "a" {
|
||||
t.Fatalf("candidate=%+v", r.candidate)
|
||||
}
|
||||
if !strings.Contains(out, "服务器命令行") || strings.Contains(out, "后台") {
|
||||
t.Fatalf("reply=%q must direct confirmation back to the server CLI only", out)
|
||||
if !strings.Contains(out, "服务器终端将自动完成管理员绑定") || strings.Contains(out, "后台") {
|
||||
t.Fatalf("reply=%q must explain terminal auto-confirmation only", out)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user