Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ require (
github.com/opencontainers/go-digest v1.0.0
github.com/openshift-eng/openshift-tests-extension v0.0.0-20260812190735-a8b44e9f9fed
github.com/openshift-kni/commatrix v0.0.5-0.20251111204857-e5a931eff73f
github.com/openshift/api v0.0.0-20261016190134-6a1201c52677
github.com/openshift/api v0.0.0-20261107000926-248dd91956ce
github.com/openshift/apiserver-library-go v0.0.0-20261105191743-7aae4f33b4b4
github.com/openshift/build-machinery-go v0.0.0-20250530140348-dc5b2804eeee
github.com/openshift/client-go v0.0.0-20261014115618-03a1e773ff3d
github.com/openshift/client-go v0.0.0-20261027103500-48133ed95dad
github.com/openshift/library-go v0.0.0-20261001144932-192662696fc7
github.com/openshift/origin/test/shared v0.0.0
github.com/openshift/osincli v0.0.0-20160924135400-fababb0555f2
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -723,14 +723,14 @@ github.com/openshift-eng/openshift-tests-extension v0.0.0-20260812190735-a8b44e9
github.com/openshift-eng/openshift-tests-extension v0.0.0-20260812190735-a8b44e9f9fed/go.mod h1:pHOS9c6BjZv91OkkHyIHAOWnYhxwcxWQkyYGEvPyUCE=
github.com/openshift-kni/commatrix v0.0.5-0.20251111204857-e5a931eff73f h1:E72Zoc+JImPehBrXkgaCbIDbSFuItvyX6RCaZ0FQE5k=
github.com/openshift-kni/commatrix v0.0.5-0.20251111204857-e5a931eff73f/go.mod h1:cDVdp0eda7EHE6tLuSeo4IqPWdAX/KJK+ogBirIGtsI=
github.com/openshift/api v0.0.0-20261016190134-6a1201c52677 h1:shK0ckOGkjKmbylHbRBlWavylKraIa6uLk5rkstNwaE=
github.com/openshift/api v0.0.0-20261016190134-6a1201c52677/go.mod h1:2oI3aXQFDjjl7l4xA9ZPSkB+l+lyfWLg7P2sWg9yEvM=
github.com/openshift/api v0.0.0-20261107000926-248dd91956ce h1:FUT6kBuZ+GbNRyxu54j8vFYOiUpgv7UVSBYg0QvUFhQ=
github.com/openshift/api v0.0.0-20261107000926-248dd91956ce/go.mod h1:2oI3aXQFDjjl7l4xA9ZPSkB+l+lyfWLg7P2sWg9yEvM=
github.com/openshift/apiserver-library-go v0.0.0-20261105191743-7aae4f33b4b4 h1:IUwrxkJ5+80h2/sCpdOhoOCE8FER+pn46zQktGyysS0=
github.com/openshift/apiserver-library-go v0.0.0-20261105191743-7aae4f33b4b4/go.mod h1:yTOZ7WWI3p2F3QIy6ZbCckONGF1KiEWRSkyGI6L9U74=
github.com/openshift/build-machinery-go v0.0.0-20250530140348-dc5b2804eeee h1:+Sp5GGnjHDhT/a/nQ1xdp43UscBMr7G5wxsYotyhzJ4=
github.com/openshift/build-machinery-go v0.0.0-20250530140348-dc5b2804eeee/go.mod h1:8jcm8UPtg2mCAsxfqKil1xrmRMI3a+XU2TZ9fF8A7TE=
github.com/openshift/client-go v0.0.0-20261014115618-03a1e773ff3d h1:r17aU6USyHX1ru8dkVZR9jCEuhLy3B7QYEo3rWKI81o=
github.com/openshift/client-go v0.0.0-20261014115618-03a1e773ff3d/go.mod h1:jJt9qm7qyuNMorTWJussOTVdx70omaSE7asKU+J7yHk=
github.com/openshift/client-go v0.0.0-20261027103500-48133ed95dad h1:KJ8Fs8QpXjtT854HjMLZyIjptLEHm4I6RC2OCZu6DvY=
github.com/openshift/client-go v0.0.0-20261027103500-48133ed95dad/go.mod h1:g4WVqRD/NuQWnM6lQP+LhLSryRganEdhYq68YghbXi4=
github.com/openshift/kubernetes v1.37.0-alpha.3.0.20261110222357-90b87c7dec80 h1:e9wCmaCuC7bRbc8/m91dr4K4BWIUugiBSKicFwAe1kI=
github.com/openshift/kubernetes v1.37.0-alpha.3.0.20261110222357-90b87c7dec80/go.mod h1:MMk9qo82fQb4QaX8i2h0NQEnjR563q2DJpeGE81S39Y=
github.com/openshift/kubernetes/staging/src/k8s.io/api v0.0.0-20261110222357-90b87c7dec80 h1:zYgDZHNH+q7YhSSzTqlH4+Y6OVBQ4jwVf9g1fRkkXs8=
Expand Down
14 changes: 13 additions & 1 deletion pkg/testsuites/standard_suites.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,12 +435,24 @@ var staticSuites = []ginkgo.TestSuite{
This test suite runs tests to validate two-node.
`),
Qualifiers: []string{
`(name.contains("[Suite:openshift/two-node") || name.contains("[OCPFeatureGate:DualReplica]") || name.contains("[OCPFeatureGate:HighlyAvailableArbiter]")) && !name.contains("[TNFMetrics]")`,
`(name.contains("[Suite:openshift/two-node") || name.contains("[OCPFeatureGate:DualReplica]") || name.contains("[OCPFeatureGate:HighlyAvailableArbiter]")) && !name.contains("[TNFMetrics]") && !name.contains("[TNFObservability]")`,
},
TestTimeout: 60 * time.Minute,
Parallelism: 1, // Tests must run serially as they involve node reboots and fencing
ClusterStabilityDuringTest: ginkgo.Disruptive,
},
{
Name: "openshift/two-node/tnf-observability",
Description: templates.LongDesc(`
This test suite validates TNF alert-agent status, registration repair, and health recovery.
`),
Qualifiers: []string{
`name.contains("[Suite:openshift/two-node]") && name.contains("[TNFObservability]") && name.contains("[Serial]")`,
},
TestTimeout: 30 * time.Minute,
Parallelism: 1,
ClusterStabilityDuringTest: ginkgo.Disruptive,
},
{
Name: "openshift/two-node/tnf-metrics",
Description: templates.LongDesc(`
Expand Down
41 changes: 37 additions & 4 deletions pkg/testsuites/suites_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func TestTNFMetricsSuiteSelectsOnlyTNFMetricsTests(t *testing.T) {
}
}

func TestTwoNodeSuiteExcludesDedicatedTNFMetricsTests(t *testing.T) {
func TestTwoNodeSuiteExcludesDedicatedTNFTests(t *testing.T) {
var suite *ginkgo.TestSuite
for i := range staticSuites {
if staticSuites[i].Name == "openshift/two-node" {
Expand All @@ -191,17 +191,18 @@ func TestTwoNodeSuiteExcludesDedicatedTNFMetricsTests(t *testing.T) {
{Name: "[sig-etcd] existing two-node recovery [Suite:openshift/two-node][Serial]"},
{Name: "[sig-etcd] two-node feature gate [OCPFeatureGate:DualReplica][Serial]"},
{Name: "[sig-etcd] TNF metrics [Suite:openshift/two-node][OCPFeatureGate:DualReplica][TNFMetrics][Serial]"},
{Name: "[sig-etcd] TNF observability [Suite:openshift/two-node][OCPFeatureGate:DualReplica][TNFObservability][Serial]"},
}
filtered, err := candidates.Filter(suite.Qualifiers)
if err != nil {
t.Fatalf("filter two-node suite: %v", err)
}
if len(filtered) != 2 {
t.Fatalf("expected two existing two-node tests and no TNF metrics test, got %d: %#v", len(filtered), filtered)
t.Fatalf("expected two existing two-node tests and no dedicated TNF tests, got %d: %#v", len(filtered), filtered)
}
for _, test := range filtered {
if test.Name == candidates[2].Name {
t.Fatalf("dedicated TNF metrics test leaked into broad two-node suite: %s", test.Name)
if test.Name == candidates[2].Name || test.Name == candidates[3].Name {
t.Fatalf("dedicated TNF test leaked into broad two-node suite: %s", test.Name)
}
}
}
Expand Down Expand Up @@ -378,3 +379,35 @@ func TestBGPVIPSuiteSelection(t *testing.T) {
})
}
}

func TestTNFObservabilitySuiteSelection(t *testing.T) {
var suite *ginkgo.TestSuite
for i := range staticSuites {
if staticSuites[i].Name == "openshift/two-node/tnf-observability" {
suite = &staticSuites[i]
break
}
}
if suite == nil {
t.Fatal("TNF observability suite not found")
}
if suite.Parallelism != 1 || suite.ClusterStabilityDuringTest != ginkgo.Disruptive {
t.Fatal("TNF observability requires serial execution with disruptive monitors")
}
for _, tc := range []struct {
name string
want int
}{
{"[Suite:openshift/two-node][TNFObservability][Serial] alert-agent status", 1},
{"[Suite:openshift/two-node][TNFObservability] missing serialization", 0},
{"[TNFObservability][Serial] another topology", 0},
{"[Suite:openshift/two-node][TNFMetrics][Serial] metrics", 0},
} {
t.Run(tc.name, func(t *testing.T) {
filtered, err := (extensiontests.ExtensionTestSpecs{{Name: tc.name}}).Filter(suite.Qualifiers)
if err != nil || len(filtered) != tc.want {
t.Fatalf("suite matched %d tests, want %d; error: %v", len(filtered), tc.want, err)
}
})
}
}
6 changes: 5 additions & 1 deletion test/extended/edge_topologies/tnf_metrics_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,10 @@ func (runner *tnfPCSRunner) run(ctx context.Context, node string, args ...string
}

func (runner *tnfPCSRunner) output(ctx context.Context, node string, args ...string) (output string, result error) {
return runner.hostOutput(ctx, node, append([]string{"pcs"}, args...)...)
}

func (runner *tnfPCSRunner) hostOutput(ctx context.Context, node string, args ...string) (output string, result error) {
if err := runner.cleanup(ctx); err != nil {
return "", fmt.Errorf("previous debug command has not been cleaned up: %w", err)
}
Expand Down Expand Up @@ -466,7 +470,7 @@ func (runner *tnfPCSRunner) output(ctx context.Context, node string, args ...str
if err := waitForTNFDefaultServiceAccount(commandCtx, runner.serviceAccounts(ns.Name)); err != nil {
return "", fmt.Errorf("wait for default ServiceAccount in TNF debug namespace %s: %w", ns.Name, err)
}
ocArgs := []string{"debug", "-q", "node/" + node, "--preserve-pod", "--to-namespace=" + ns.Name, "--", "chroot", "/host", "pcs"}
ocArgs := []string{"debug", "-q", "node/" + node, "--preserve-pod", "--to-namespace=" + ns.Name, "--", "chroot", "/host"}
ocArgs = append(ocArgs, args...)
output, err = runTNFOC(commandCtx, runner.oc, ocArgs...)
return output, err
Expand Down
240 changes: 240 additions & 0 deletions test/extended/edge_topologies/tnf_observability.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
package edge_topologies

import (
"context"
"fmt"
"sort"
"strings"
"time"

g "github.com/onsi/ginkgo/v2"
o "github.com/onsi/gomega"
configv1 "github.com/openshift/api/config/v1"
etcdv1 "github.com/openshift/api/etcd/v1"
"github.com/openshift/origin/test/extended/edge_topologies/utils"
"github.com/openshift/origin/test/extended/edge_topologies/utils/apis"
"github.com/openshift/origin/test/extended/edge_topologies/utils/services"
"github.com/openshift/origin/test/extended/etcd/helpers"
exutil "github.com/openshift/origin/test/extended/util"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/uuid"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/tools/cache"
watchtools "k8s.io/client-go/tools/watch"
)

var _ = g.Describe("[sig-etcd][apigroup:etcd.openshift.io][OCPFeatureGate:DualReplica][OCPFeatureGate:TNFObservability][Suite:openshift/two-node][TNFObservability][Serial][Disruptive] TNF alert-agent observability", func() {
var (
oc = exutil.NewCLIWithoutNamespace("tnf-observability").AsAdmin()
pcs *tnfPCSRunner
nodes []string
)

g.BeforeEach(func() {
utils.SkipIfNotTopology(oc, configv1.DualReplicaTopologyMode)
gateCtx, cancelGate := context.WithTimeout(context.Background(), tnfCommandTimeout)
enabled, err := tnfObservabilityEnabled(gateCtx, oc)
cancelGate()
o.Expect(err).NotTo(o.HaveOccurred())
if !enabled {
g.Skip("TNFObservability is disabled for the collector release")
}
pcs, nodes = setupTNFObservability(oc)
o.Expect(waitForTNFAlertStatus(context.Background(), oc, nodes, time.Now())).To(o.Succeed(), "establish fresh, healthy alert-agent status")
})

g.It("reports both healthy alert agents on both nodes", func() {
output, err := pcs.output(context.Background(), nodes[0], "alert", "config", "--output-format", "json")
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(expectTNFAlertRegistrations(output)).To(o.Succeed())
pc, err := apis.GetPacemakerCluster(oc)
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(waitForTNFAlertStatus(context.Background(), oc, nodes, pc.Status.LastUpdated.Time)).To(o.Succeed(), "remain healthy across another collection")
o.Expect(apis.ExpectPacemakerHealthCheckNotDegraded(oc)).To(o.Succeed())
})

g.It("reports and repairs missing and misconfigured alert registrations", func() {
ctx := context.Background()
g.DeferCleanup(func() {
o.Expect(waitForTNFAlertStatus(context.Background(), oc, nodes, time.Now())).To(o.Succeed(), "recover after restoring registrations")
o.Expect(apis.WaitForPacemakerHealthCheckCleared(oc, tnfObservabilityTimeout)).To(o.Succeed())
})
for _, id := range []string{services.TaintAlertID, services.UntaintAlertID} {
backupTNFAlertRegistration(ctx, pcs, nodes[0], id)
}

for _, fault := range []struct {
description string
agent etcdv1.PacemakerClusterAlertAgentName
reason string
command []string
}{
{
description: "remove the taint registration",
agent: etcdv1.PacemakerClusterAlertAgentNameTaint,
reason: etcdv1.AlertAgentConfiguredReasonNotRegistered,
command: []string{"pcs", "alert", "delete", services.TaintAlertID},
},
{
description: "change the untaint script path",
agent: etcdv1.PacemakerClusterAlertAgentNameUntaint,
reason: etcdv1.AlertAgentConfiguredReasonMisconfigured,
command: []string{"pcs", "alert", "update", services.UntaintAlertID, "path=/var/lib/pacemaker/alerts/tnf-e2e-invalid.sh"},
},
{
description: "change only the taint event selector",
agent: etcdv1.PacemakerClusterAlertAgentNameTaint,
reason: etcdv1.AlertAgentConfiguredReasonMisconfigured,
command: []string{"cibadmin", "--replace", "--xpath", tnfAlertXPath(services.TaintAlertID) + "/select", "--xml-text", "<select><select_nodes/></select>"},
},
} {
g.By(fault.description)
failedAt := observeTNFRegistrationFault(ctx, oc, pcs, nodes, fault.command, tnfAlertFailure{
agent: fault.agent, condition: etcdv1.AlertAgentConfiguredConditionType, reason: fault.reason,
})
g.By("waiting for automatic repair and a subsequent healthy collection")
o.Expect(waitForTNFAlertStatus(ctx, oc, nodes, failedAt)).To(o.Succeed())
output, err := pcs.output(ctx, nodes[0], "alert", "config", "--output-format", "json")
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(expectTNFAlertRegistrations(output)).To(o.Succeed())
o.Expect(apis.WaitForPacemakerHealthCheckCleared(oc, tnfObservabilityTimeout)).To(o.Succeed())
}
})

g.It("retains alert observations and defers repairs when the collector release is unresolved", func() {
testTNFUnresolvedCollectorRelease(oc, pcs, nodes)
})

g.It("reports node-local alert script drift and recovers health after restoration", func() {
ctx := context.Background()
target, path := nodes[0], services.TaintAlertScriptPath
backup := "/var/tmp/tnf-alert-" + string(uuid.NewUUID())
restore := func(ctx context.Context) error {
_, err := pcs.hostOutput(ctx, target, "bash", "-ceu", `if test -f "$2"; then cp -a -- "$2" "$1"; fi`, "--", path, backup)
return err
}
g.DeferCleanup(func() {
o.Expect(retryTNFOperation(context.Background(), tnfPollInterval, tnfCommandTimeout, restore)).To(o.Succeed(), "restore the MCO-managed script")
o.Expect(waitForTNFMCOState(context.Background(), oc, target, "Done", "")).To(o.Succeed())
o.Expect(waitForTNFAlertStatus(context.Background(), oc, nodes, time.Now())).To(o.Succeed())
o.Expect(apis.WaitForPacemakerHealthCheckCleared(oc, tnfObservabilityTimeout)).To(o.Succeed())
_, err := pcs.hostOutput(context.Background(), target, "rm", "-f", "--", backup)
o.Expect(err).NotTo(o.HaveOccurred())
})

g.By("changing script content without changing its executable behavior")
_, err := pcs.hostOutput(ctx, target, "bash", "-ceu", `test -x "$1"
test ! -e "$2"
cp -a -- "$1" "$2"
printf '\n# TNF observability drift test\n' >> "$1"`, "--", path, backup)
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(waitForTNFMCOState(ctx, oc, target, "Degraded", path)).To(o.Succeed(), "MCO must identify the alert script drift")
o.Expect(waitForTNFAlertStatus(ctx, oc, nodes, time.Now(), tnfAlertFailure{
node: target, agent: etcdv1.PacemakerClusterAlertAgentNameTaint,
condition: etcdv1.AlertAgentAvailableConditionType, reason: etcdv1.AlertAgentAvailableReasonUnavailable,
})).To(o.Succeed(), "only the affected node's taint agent should be unavailable")
o.Expect(apis.WaitForPacemakerHealthCheckDegraded(oc, string(etcdv1.PacemakerClusterAlertAgentNameTaint), tnfObservabilityTimeout)).To(o.Succeed())

g.By("restoring the script and waiting for MCO and Pacemaker health to recover")
o.Expect(restore(ctx)).To(o.Succeed())
o.Expect(waitForTNFMCOState(ctx, oc, target, "Done", "")).To(o.Succeed())
o.Expect(waitForTNFAlertStatus(ctx, oc, nodes, time.Now())).To(o.Succeed())
o.Expect(apis.WaitForPacemakerHealthCheckCleared(oc, tnfObservabilityTimeout)).To(o.Succeed())
})
})

func setupTNFObservability(oc *exutil.CLI) (*tnfPCSRunner, []string) {
utils.SkipIfClusterIsNotHealthy(oc, helpers.NewEtcdClientFactory(oc.KubeClient()))
ctx, cancel := context.WithTimeout(context.Background(), tnfCommandTimeout)
defer cancel()
core := oc.AdminKubeClient().CoreV1()
pcs := &tnfPCSRunner{oc: oc, namespaces: core.Namespaces(), serviceAccounts: core.ServiceAccounts}
g.DeferCleanup(func() {
o.Expect(pcs.cleanup(context.Background())).To(o.Succeed())
})
masters, err := core.Nodes().List(ctx, metav1.ListOptions{LabelSelector: "node-role.kubernetes.io/master="})
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(masters.Items).To(o.HaveLen(2))
var nodes []string
for _, node := range masters.Items {
nodes = append(nodes, node.Name)
o.Expect(node.Annotations["machineconfiguration.openshift.io/state"]).To(o.Equal("Done"), "MCO must be healthy before fault injection")
}
sort.Strings(nodes)
return pcs, nodes
}

func observeTNFRegistrationFault(ctx context.Context, oc *exutil.CLI, pcs *tnfPCSRunner, nodes, command []string, failure tnfAlertFailure) time.Time {
pc, err := apis.GetPacemakerCluster(oc)
o.Expect(err).NotTo(o.HaveOccurred())
watchCtx, cancel := context.WithTimeout(ctx, tnfObservabilityTimeout)
defer cancel()

// Resume from the last event so a disconnect cannot hide the brief pre-repair status.
resource := oc.AdminDynamicClient().Resource(apis.PacemakerClusterGVR)
stream, err := watchtools.NewRetryWatcherWithContext(watchCtx, pc.ResourceVersion, &cache.ListWatch{
WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) {
options.FieldSelector = "metadata.name=cluster"
stream, err := resource.Watch(ctx, options)
if apierrors.IsResourceExpired(err) || apierrors.IsGone(err) {
// RetryWatcher only treats expiration as terminal when it arrives as an event.
events := make(chan watch.Event, 1)
events <- watch.Event{Type: watch.Error, Object: &apierrors.NewResourceExpired(err.Error()).ErrStatus}
close(events)
return watch.NewProxyWatcher(events), nil
}
return stream, err
},
})
o.Expect(err).NotTo(o.HaveOccurred())
defer stream.Stop()

_, err = pcs.hostOutput(ctx, nodes[0], command...)
o.Expect(err).NotTo(o.HaveOccurred())

var failedAt time.Time
lastObservation := "no new collection observed"
_, err = watchtools.UntilWithoutRetry(watchCtx, stream, func(event watch.Event) (bool, error) {
Comment thread
vimauro marked this conversation as resolved.
Resolved
if event.Type == watch.Error {
return false, apierrors.FromObject(event.Object)
}
if event.Type != watch.Modified {
return false, nil
}
obj, ok := event.Object.(*unstructured.Unstructured)
if !ok {
return false, fmt.Errorf("unexpected PacemakerCluster watch object %T", event.Object)
}
var observed etcdv1.PacemakerCluster
if err := runtime.DefaultUnstructuredConverter.FromUnstructured(obj.Object, &observed); err != nil {
return false, err
}
if !observed.Status.LastUpdated.After(pc.Status.LastUpdated.Time) {
return false, nil
}
if err := expectTNFAlertStatus(&observed, nodes, failure); err != nil {
lastObservation = err.Error()
return false, nil
}
failedAt = observed.Status.LastUpdated.Time
return true, nil
})
o.Expect(err).NotTo(o.HaveOccurred(), "capture the pre-repair failure status: %s", lastObservation)
return failedAt
}

func waitForTNFMCOState(ctx context.Context, oc *exutil.CLI, node, state, reason string) error {
return retryTNFOperation(ctx, 5*time.Second, tnfObservabilityTimeout, func(ctx context.Context) error {
n, err := oc.AdminKubeClient().CoreV1().Nodes().Get(ctx, node, metav1.GetOptions{})
if err != nil {
return err
}
if n.Annotations["machineconfiguration.openshift.io/state"] != state || !strings.Contains(n.Annotations["machineconfiguration.openshift.io/reason"], reason) {
return fmt.Errorf("waiting for MCO state %s and reason containing %q", state, reason)
}
return nil
})
}
Loading