| 202 | |
| 203 | |
| 204 | def test_prep_pub_nodegroup(master_opts): |
| 205 | master_opts["nodegroups"] = { |
| 206 | "group1": "L@spongebob,patrick", |
| 207 | "group2": "G@os:squidward", |
| 208 | "group3": "G@os:plankton and N@group1", |
| 209 | } |
| 210 | local_client = salt.client.get_local_client(mopts=master_opts) |
| 211 | result = local_client._prep_pub( |
| 212 | tgt="group1", |
| 213 | fun="test.ping", |
| 214 | arg="", |
| 215 | tgt_type="nodegroup", |
| 216 | ret="", |
| 217 | jid="123", |
| 218 | timeout=7, |
| 219 | ) |
| 220 | expected = { |
| 221 | "arg": "", |
| 222 | "cmd": "publish", |
| 223 | "fun": "test.ping", |
| 224 | "jid": "123", |
| 225 | "key": "", |
| 226 | "ret": "", |
| 227 | "tgt": "L@spongebob,patrick", |
| 228 | "tgt_type": "compound", |
| 229 | "user": local_client.salt_user, |
| 230 | } |
| 231 | assert result == expected |
| 232 | |
| 233 | |
| 234 | def test_prep_pub_compound(local_client): |