Harden image admission, resource recovery and session renewal
Add exact-image compatibility policy, experimental admission, paginated build history and shared reauthentication checks. Preserve uncertain Docker creation records, bound frontend resource waits and renew runtime sessions proactively. Lazy-load and split Monaco, add regression and opt-in live Docker fault tests, and record full race and real-browser acceptance results.
This commit is contained in:
@@ -27,7 +27,7 @@ func TestUpgradeWorkspaceCompatibility(t *testing.T) {
|
||||
{"single-to-seven", "7", "/workspace", false, false},
|
||||
{"migrated-to-seven", "7", "/workspace", true, false},
|
||||
{"legacy-to-six", "6", "/data/dsh-home", true, false},
|
||||
{"legacy-to-unknown", "", "/data/dsh-home", true, false},
|
||||
{"legacy-to-unknown", "", "/data/dsh-home", true, true},
|
||||
{"single-to-six", "6", "/workspace", false, true},
|
||||
{"single-to-unknown", "", "/workspace", false, true},
|
||||
} {
|
||||
@@ -48,7 +48,13 @@ func TestUpgradeWorkspaceCompatibility(t *testing.T) {
|
||||
if (err != nil) != tc.reject {
|
||||
t.Fatalf("error=%v", err)
|
||||
}
|
||||
if tc.reject || tc.recipe != "7" {
|
||||
if !tc.reject && tc.recipe != "7" {
|
||||
if !strings.Contains(string(config["Env"]), "XDG_DATA_HOME=/data/dsh-home/.local/share") || string(host["Mounts"]) != string(raw) {
|
||||
t.Fatal(config, host)
|
||||
}
|
||||
return
|
||||
}
|
||||
if tc.reject {
|
||||
if string(host["Mounts"]) != string(raw) || string(config["Env"]) != before {
|
||||
t.Fatal("legacy or rejected config changed")
|
||||
}
|
||||
@@ -149,7 +155,7 @@ func TestUpgradeLifecycle(t *testing.T) {
|
||||
if mode == "invalid-image" {
|
||||
role = "builder"
|
||||
}
|
||||
writeJSON(w, map[string]any{"Id": image, "Config": map[string]any{"Labels": map[string]string{"dsh-mgr.role": role, "dsh-mgr.version": "v2", "dsh-mgr.recipe": imageRecipeRev}}})
|
||||
writeJSON(w, map[string]any{"Id": image, "Os": "linux", "Architecture": "amd64", "Config": map[string]any{"Labels": map[string]string{"dsh-mgr.role": role, "dsh-mgr.version": "v2", "dsh-mgr.recipe": imageRecipeRev}}})
|
||||
case p == "/containers/create":
|
||||
if !strings.HasPrefix(r.URL.Query().Get("name"), "dsh-inst-one-upgrade-") {
|
||||
t.Error("missing unique name")
|
||||
@@ -238,6 +244,9 @@ func TestUpgradeLifecycle(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
if _, err := a.s.DB.Exec("INSERT INTO image_admissions(image_id,version,recipe_rev,platform,state,evidence,admitted_by,admitted_at) VALUES(?,'v2',?,?,'compatible','test acceptance','test','now')", image, imageRecipeRev, imagePlatform); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
base := filepath.Join(a.root, "workspaces", "owner", "instances", "one")
|
||||
home = filepath.Join(base, "home")
|
||||
shared = filepath.Join(a.root, "workspaces", "owner", "files")
|
||||
|
||||
Reference in New Issue
Block a user