بنقرة واحدة
cnf-core-network-review
Use this skill to review code changes in the `tests/cnf/core/network` directory.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Use this skill to review code changes in the `tests/cnf/core/network` directory.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | cnf-core-network-review |
| description | Use this skill to review code changes in the `tests/cnf/core/network` directory. |
| disable-model-invocation | true |
tests/cnf/core/network code reviewtests/cnf/core/network/**.This repository is using the latest stable Go version (check go.mod to verify). Ensure any suspected issues are still valid with the latest Go version.
There is a top-level shared tests/internal directory and, under tests/cnf/core/network, a shared internal directory along with directories for each test suite: accelerator, cni, day1day2, dpdk, metallb, policy, security, and sriov.
tests/cnf/core/network/internal)netinittools: exports APIClient (*clients.Settings) and NetConfig (*netconfig.NetworkConfig). An init() function auto-initializes both on package load. Designed for dot-import (. "…/netinittools") so APIClient and NetConfig are available without a package prefix.netconfig: configuration via default.yaml and ECO_CNF_CORE_NET_* environment variables (struct tags: envconfig:"ECO_CNF_CORE_NET_…").netenv: cluster environment helpers (IsSNOCluster(), DoesClusterHasEnoughNodes(), DeployPerformanceProfile(), SetStaticRoute(), etc.).netparam: shared constants (IP families, subnets, timeouts, labels) and types (e.g. BFDDescription).cmd: command and connectivity helpers (ICMPConnectivityCheck(), ValidateTCPTraffic(), RunCommandOnHostNetworkPod(), GetSrIovPf()). Also provides Juniper switch management (NewSession() → Junos type with Config(), RunCommand(), SaveInterfaceConfigs(), etc.).define: NAD builders (TapNad(), MacVlanNad(), VlanNad(), IPVlanNad(), HostDeviceNad(), CreateExternalNad()).ipaddr: IP address utilities (RemovePrefix()).frrconfig: FRR daemon configuration generation (DefineBaseConfig(), CreateStaticIPAnnotations()).netnmstate: NMState instance helpers (CreateNewNMStateAndWaitUntilItsRunning(), CreatePolicyAndWaitUntilItsAvailable(), ConfigureVFsAndWaitUntilItsConfigured(), CheckThatWorkersDeployedWithBondVfs(), etc.).Inside each test suite directory (e.g. sriov/, metallb/), there are typically:
internal/: suite-specific helpers and params
internal/tsparams/: parameters and constants for the suite (avoid test assertions here)internal/*env/: optional environment/setup helpers (e.g. sriovenv, metallbenv, dpdkenv)metallb/internal/frr/, metallb/internal/prometheus/, metallb/internal/cmd/, day1day2/internal/juniper/, dpdk/internal/link/)tests/: test cases (.go files, not _test.go)*_suite_test.go: Ginkgo suite entrypoint (suite-wide setup/teardown + reporting)namespace.NewBuilder(APIClient, nsName).CleanObjects(…) in AfterEach to remove pods/resources.AfterSuite.AfterAll or AfterEach, even on failure.By() blocksBy("description") is used extensively to document logical steps inside test cases. New tests should follow this convention.
internal vs shared tests/cnf/core/network/internal).path/to/file.go (+ function name and/or approximate line range)time.Sleep, reasonable timeouts/poll intervals).Eventually / Consistently assertions use explicit timeout and poll-interval values (prefer named constants from netparam or tsparams over magic numbers).reportxml.ID("...") set on the It(...) or DescribeTable(...).DescribeTable/Entry) use reportxml.SetProperty(…) on Entry calls to tag variations.By("…") calls.*/tests/*.go, *_test.go), not internal packages.internal/helper package (or shared tests/cnf/core/network/internal when broadly applicable).tests/cnf/core/network/internal (not inside a single suite).<suite>/internal/tsparams/, not in test files or shared internal.github.com/rh-ecosystem-edge/eco-goinfra packages are used for all Kubernetes API interactions.eco-goinfra packages.NetConfig (via netconfig/netinittools) rather than hardcoded strings.make vet passes.make lint passes.