test: verify recovered image markers cannot skip credentials
All checks were successful
Tests / Declarative: Post Actions passed: 314
All checks were successful
Tests / Declarative: Post Actions passed: 314
This commit is contained in:
parent
1c110c930c
commit
62131596fc
@ -72,6 +72,22 @@ func TestIdentityFailureAndRetry(t *testing.T) {
|
|||||||
if err := run("1"); err != nil {
|
if err := run("1"); err != nil {
|
||||||
t.Fatal("completed setup should not reset passwords", err)
|
t.Fatal("completed setup should not reset passwords", err)
|
||||||
}
|
}
|
||||||
|
// Re-injection into a previously booted image must not trust its old marker.
|
||||||
|
if err := os.WriteFile(filepath.Join(etc, "node-identity.pending"), []byte("pending"), 0600); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
if err := os.WriteFile(envPath, []byte(synthetic), 0600); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
if run("1") == nil {
|
||||||
|
t.Fatal("old marker suppressed newly injected credentials")
|
||||||
|
}
|
||||||
|
if err := run("0"); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
if _, err := os.Stat(filepath.Join(etc, "node-identity.pending")); !os.IsNotExist(err) {
|
||||||
|
t.Fatal("successful identity left a pending marker")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestIdentityEnabledWithoutCloudInit(t *testing.T) {
|
func TestIdentityEnabledWithoutCloudInit(t *testing.T) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user