liveBook · Manning

Test method

As explained in 100 SQL Server Mistakes and How to Avoid Them

A test method determines whether a configuration resource currently matches its desired state.

Mistake #1: treating configuration management as irrelevant to SQL Server. A test method checks whether a resource already matches its desired state; only detected drift should trigger the set method. For example, DSC repeatedly checks whether xp_cmdshell is enabled and disables it when the desired state is disabled. section 8.9

Use the test method as the safe control point:

  • Evaluate the current configuration before changing it. section 8.9
  • Treat the desired state as the comparison target, not as an unconditional command. section 8.9
  • Use recurring evaluation to expose drift and support consistent, secure administration. section 8.9
Figure 8.3 Configuration management process

Follow the configuration-management process from testing the current state to applying corrective configuration. section 8.9

How 100 SQL Server Mistakes and How to Avoid Them covers it

How deep it goes
Defines the test-before-set cycle and illustrates it operationally, but does not detail test-method implementation internals.
Examples
Uses recurring DSC checks for xp_cmdshell and a multi-server SQL Server configuration process.
What it assumes
Assumes basic configuration-management terminology while introducing resources, desired state, testing, and corrective setting.
What you can do after
Diagnose configuration drift and determine when a resource should apply its corrective set method.
How it connects
Connects desired state, configuration drift, resources, set methods, manifests, and PowerShell Desired State Configuration.

This explainer was generated by Manning's knowledge graph from the text of 100 SQL Server Mistakes and How to Avoid Them. The section links point to the parts of the book it draws on.