File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
internal/integration/mtest Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -802,10 +802,10 @@ func verifyRunOnBlockConstraint(rob RunOnBlock) error {
802802 if rob .CSFLEEnabled () && rob .CSFLE .Options != nil {
803803 return fmt .Errorf ("auto encryption required (GODRIVER-3486)" )
804804 }
805-
806805 if rob .CSFLEEnabled () && ! IsCSFLEEnabled () {
807806 return fmt .Errorf ("runOnBlock requires CSFLE to be enabled. Build with the cse tag to enable" )
808- } else if ! rob .CSFLEEnabled () && IsCSFLEEnabled () {
807+ }
808+ if rob .CSFLEDisabled () && IsCSFLEEnabled () {
809809 return fmt .Errorf ("runOnBlock requires CSFLE to be disabled. Build without the cse tag to disable" )
810810 }
811811 if rob .CSFLEEnabled () {
Original file line number Diff line number Diff line change @@ -100,10 +100,20 @@ type RunOnBlock struct {
100100 CSFLE * CSFLE `bson:"csfleConfiguration"`
101101}
102102
103+ // CSFLEEnabled returns true if CSFLE support is explicitly required in the
104+ // "runOnRequirement" block. It returns false if the CSFLE requirement is
105+ // unspecified or explicitly false.
103106func (r * RunOnBlock ) CSFLEEnabled () bool {
104107 return r .CSFLE != nil && (r .CSFLE .Boolean || r .CSFLE .Options != nil )
105108}
106109
110+ // CSFLEDisabled returns true if CSFLE support is explicitly forbidden in the
111+ // "runOnRequirement" block. It returns false if the CSFLE requirement is
112+ // unspecified or explicitly true.
113+ func (r * RunOnBlock ) CSFLEDisabled () bool {
114+ return r .CSFLE != nil && ! r .CSFLE .Boolean
115+ }
116+
107117// UnmarshalBSON implements custom BSON unmarshalling behavior for RunOnBlock because some test formats use the
108118// "topology" key while the unified test format uses "topologies".
109119func (r * RunOnBlock ) UnmarshalBSON (data []byte ) error {
You can’t perform that action at this time.
0 commit comments