// Run will fully test a to support all specified features in the matrix.
177635
func Run(t *testing.T, config *Config) {
	t.Run("PublishSubscribeQOS0", func(t *testing.T) {
		PublishSubscribeTest(t, config, "pubsub/1", "pubsub/1", 0, 0, 0)
	})

	t.Run("PublishSubscribeQOS1", func(t *testing.T) {
		PublishSubscribeTest(t, config, "pubsub/2", "pubsub/2", 1, 1, 1)
	})

	t.Run("PublishSubscribeQOS2", func(t *testing.T) {
		PublishSubscribeTest(t, config, "pubsub/3", "pubsub/3", 2, 2, 2)
	})

	t.Run("PublishSubscribeQOSKeep0", func(t *testing.T) {
		PublishSubscribeTest(t, config, "keep/1", "keep/1", 1, 0, 0)
	})

	t.Run("PublishSubscribeQOSKeep1", func(t *testing.T) {
		PublishSubscribeTest(t, config, "keep/2", "keep/2", 2, 1, 1)
	})

	t.Run("PublishSubscribeWildcardOne", func(t *testing.T) {
		PublishSubscribeTest(t, config, "wildcard/1/foo", "wildcard/1/+", 0, 0, 0)
	})

	t.Run("PublishSubscribeWildcardSome", func(t *testing.T) {
		PublishSubscribeTest(t, config, "wildcard/2/foo", "wildcard/2/#", 0, 0, 0)
	})

	t.Run("PublishSubscribeQOSDowngrade1To0", func(t *testing.T) {
		PublishSubscribeTest(t, config, "downgrade/1", "downgrade/1", 0, 1, 0)
	})

	t.Run("PublishSubscribeQOSDowngrade2To0", func(t *testing.T) {
		PublishSubscribeTest(t, config, "downgrade/2", "downgrade/2", 0, 2, 0)
	})

	t.Run("PublishSubscribeQOSDowngrade2To1", func(t *testing.T) {
		PublishSubscribeTest(t, config, "downgrade/3", "downgrade/3", 1, 2, 1)
	})

	t.Run("UnsubscribeQOS0", func(t *testing.T) {
		UnsubscribeTest(t, config, "unsub/1", 0)
	})

	t.Run("UnsubscribeQOS1", func(t *testing.T) {
		UnsubscribeTest(t, config, "unsub/2", 1)
	})

	t.Run("UnsubscribeQOS2", func(t *testing.T) {
		UnsubscribeTest(t, config, "unsub/3", 2)
	})

	t.Run("UnsubscribeNotExistingSubscription", func(t *testing.T) {
		UnsubscribeNotExistingSubscriptionTest(t, config, "unsub/4")
	})

	t.Run("UnsubscribeOverlappingSubscription", func(t *testing.T) {
		UnsubscribeOverlappingSubscriptions(t, config, "unsub/5")
	})

	t.Run("SubscriptionUpgradeQOS0To1", func(t *testing.T) {
		SubscriptionUpgradeTest(t, config, "subup/1", 0, 1)
	})

	t.Run("SubscriptionUpgradeQOS1To2", func(t *testing.T) {
		SubscriptionUpgradeTest(t, config, "subup/2", 1, 2)
	})

	t.Run("OverlappingSubscriptionsWildcardOne", func(t *testing.T) {
		OverlappingSubscriptionsTest(t, config, "ovlsub/1/foo", "ovlsub/1/+")
	})

	t.Run("OverlappingSubscriptionsWildcardSome", func(t *testing.T) {
		OverlappingSubscriptionsTest(t, config, "ovlsub/2/foo", "ovlsub/2/#")
	})

	t.Run("MultipleSubscription", func(t *testing.T) {
		MultipleSubscriptionTest(t, config, "mulsub")
	})

	t.Run("DuplicateSubscription", func(t *testing.T) {
		DuplicateSubscriptionTest(t, config, "dblsub")
	})

	t.Run("IsolatedSubscription", func(t *testing.T) {
		IsolatedSubscriptionTest(t, config, "islsub")
	})

	t.Run("WillQOS0", func(t *testing.T) {
		WillTest(t, config, "will/1", 0, 0)
	})

	t.Run("WillQOS1", func(t *testing.T) {
		WillTest(t, config, "will/2", 1, 1)
	})

	t.Run("WillQOS2", func(t *testing.T) {
		WillTest(t, config, "will/3", 2, 2)
	})

	t.Run("CleanWill", func(t *testing.T) {
		CleanWillTest(t, config, "will/4")
	})

	t.Run("KeepAlive", func(t *testing.T) {
		KeepAliveTest(t, config)
	})

	t.Run("KeepAliveTimeout", func(t *testing.T) {
		KeepAliveTimeoutTest(t, config)
	})

	t.Run("UnexpectedPubrel", func(t *testing.T) {
		UnexpectedPubrelTest(t, config)
	})

	if config.RetainedMessages {
		t.Run("RetainedMessageQOS0", func(t *testing.T) {
			RetainedMessageTest(t, config, "retained/1", "retained/1", 0, 0)
		})

		t.Run("RetainedMessageQOS1", func(t *testing.T) {
			RetainedMessageTest(t, config, "retained/2", "retained/2", 1, 1)
		})

		t.Run("RetainedMessageQOS2", func(t *testing.T) {
			RetainedMessageTest(t, config, "retained/3", "retained/3", 2, 2)
		})

		t.Run("RetainedMessageDowngrade1To0", func(t *testing.T) {
			RetainedMessageTest(t, config, "retained/4", "retained/4", 0, 1)
		})

		t.Run("RetainedMessageDowngrade2To0", func(t *testing.T) {
			RetainedMessageTest(t, config, "retained/5", "retained/5", 0, 2)
		})

		t.Run("RetainedMessageDowngrade2To1", func(t *testing.T) {
			RetainedMessageTest(t, config, "retained/6", "retained/6", 1, 2)
		})

		t.Run("RetainedMessageWildcardOne", func(t *testing.T) {
			RetainedMessageTest(t, config, "retained/7/foo/bar", "retained/7/foo/+", 0, 0)
		})

		t.Run("RetainedMessageWildcardSome", func(t *testing.T) {
			RetainedMessageTest(t, config, "retained/8/foo/bar", "retained/8/#", 0, 0)
		})

		t.Run("RetainedMessageReplace", func(t *testing.T) {
			RetainedMessageReplaceTest(t, config, "retained/9")
		})

		t.Run("ClearRetainedMessage", func(t *testing.T) {
			ClearRetainedMessageTest(t, config, "retained/10")
		})

		t.Run("DirectRetainedMessage", func(t *testing.T) {
			DirectRetainedMessageTest(t, config, "retained/11")
		})

		t.Run("DirectClearRetainedMessage", func(t *testing.T) {
			DirectClearRetainedMessageTest(t, config, "retained/12")
		})

		t.Run("RetainedWill", func(t *testing.T) {
			RetainedWillTest(t, config, "retained/13")
		})

		t.Run("RetainedMessageResubscription", func(t *testing.T) {
			RetainedMessageResubscriptionTest(t, config, "retained/14")
		})
	}

	if config.StoredPackets {
		t.Run("PublishResendQOS1", func(t *testing.T) {
			PublishResendQOS1Test(t, config, "pubres/1")
		})

		t.Run("PublishResendQOS2", func(t *testing.T) {
			PublishResendQOS2Test(t, config, "pubres/2")
		})

		t.Run("PubrelResendQOS2", func(t *testing.T) {
			PubrelResendQOS2Test(t, config, "pubres/3")
		})
	}

	if config.StoredSubscriptions {
		t.Run("StoredSubscriptionsQOS0", func(t *testing.T) {
			StoredSubscriptionsTest(t, config, "strdsub/1", 0)
		})

		t.Run("StoredSubscriptionsQOS1", func(t *testing.T) {
			StoredSubscriptionsTest(t, config, "strdsub/2", 1)
		})

		t.Run("StoredSubscriptionsQOS2", func(t *testing.T) {
			StoredSubscriptionsTest(t, config, "strdsub/3", 2)
		})

		t.Run("CleanStoredSubscriptions", func(t *testing.T) {
			CleanStoredSubscriptionsTest(t, config, "strdsub/4")
		})

		t.Run("RemoveStoredSubscription", func(t *testing.T) {
			RemoveStoredSubscriptionTest(t, config, "strdsub/5")
		})
	}

	if config.OfflineSubscriptions {
		t.Run("OfflineSubscriptionQOS00", func(t *testing.T) {
			OfflineSubscriptionTest(t, config, "offsub/1", 0, 0, false)
		})

		t.Run("OfflineSubscriptionQOS01", func(t *testing.T) {
			OfflineSubscriptionTest(t, config, "offsub/2", 0, 1, false)
		})

		t.Run("OfflineSubscriptionQOS10", func(t *testing.T) {
			OfflineSubscriptionTest(t, config, "offsub/3", 1, 0, false)
		})

		t.Run("OfflineSubscriptionQOS11", func(t *testing.T) {
			OfflineSubscriptionTest(t, config, "offsub/4", 1, 1, true)
		})

		t.Run("OfflineSubscriptionQOS12", func(t *testing.T) {
			OfflineSubscriptionTest(t, config, "offsub/5", 1, 2, true)
		})

		t.Run("OfflineSubscriptionQOS21", func(t *testing.T) {
			OfflineSubscriptionTest(t, config, "offsub/6", 2, 1, true)
		})

		t.Run("OfflineSubscriptionQOS22", func(t *testing.T) {
			OfflineSubscriptionTest(t, config, "offsub/7", 2, 2, true)
		})
	}

	if config.OfflineSubscriptions && config.RetainedMessages {
		t.Run("OfflineSubscriptionRetainedQOS0", func(t *testing.T) {
			OfflineSubscriptionRetainedTest(t, config, "offsubret/1", 0, 0, false)
		})

		t.Run("OfflineSubscriptionRetainedQOS1", func(t *testing.T) {
			OfflineSubscriptionRetainedTest(t, config, "offsubret/2", 1, 1, true)
		})

		t.Run("OfflineSubscriptionRetainedQOS2", func(t *testing.T) {
			OfflineSubscriptionRetainedTest(t, config, "offsubret/3", 2, 2, true)
		})
	}

	if config.Authentication {
		t.Run("Authentication", func(t *testing.T) {
			AuthenticationTest(t, config)
		})
	}

	if config.UniqueClientIDs {
		t.Run("UniqueClientIDUnclean", func(t *testing.T) {
			UniqueClientIDUncleanTest(t, config)
		})

		t.Run("UniqueClientIDClean", func(t *testing.T) {
			UniqueClientIDCleanTest(t, config)
		})
	}

	if config.RootSlashDistinction {
		t.Run("RootSlashDistinction", func(t *testing.T) {
			RootSlashDistinctionTest(t, config, "rootslash")
		})
	}
}
779520
func (e *SigsList) Run(m libkb.MetaContext) error {
	arg := libkb.NewLoadUserArgWithMetaContext(m)
	if len(e.Username) > 0 {
		arg = arg.WithName(e.Username)
	} else {
		arg = arg.WithSelf(true)
	}

	var err error
	e.user, err = libkb.LoadUser(arg)
	if err != nil {
		return err
	}

	e.sigs = e.user.IDTable().Order
	return e.processSigs()
}
1116274
func (c *configCommand) Run(ctx *cmd.Context) error {
	client, err := c.getAPI()
	if err != nil {
		return err
	}
	defer client.Close()
	return c.action(client, ctx)
}
553728
func (c *RemoveCommand) Run(ctx *cmd.Context) error {
	return c.RunWithAPI(ctx, func(api SpaceAPI, ctx *cmd.Context) error {
		// Remove the space.
		err := api.RemoveSpace(c.name)
		if err != nil {
			return errors.Annotatef(err, "cannot remove space %q", c.name)
		}
		ctx.Infof("removed space %q", c.name)
		return nil
	})
}
126734
func (f *FakeCommandRunner) Run(cmd string) error {
	_, err := f.CombinedOutput(cmd)
	return err
}
1267949
func Run(stmt ast.Stmt, env *Env) (interface{}, error) {
	return RunContext(context.Background(), stmt, env)
}
543904
func (c *listImagesCommand) Run(ctx *cmd.Context) (err error) {
	api, err := getImageMetadataListAPI(c)
	if err != nil {
		return err
	}
	defer api.Close()

	found, err := api.List(c.Stream, c.Region, c.Series, c.Arches, c.VirtType, c.RootStorageType)
	if err != nil {
		return err
	}
	if len(found) == 0 {
		return nil
	}

	info, errs := convertDetailsToInfo(found)
	if len(errs) > 0 {
		// display individual error
		fmt.Fprintf(ctx.Stderr, strings.Join(errs, "\n"))
	}

	var output interface{}
	switch c.out.Name() {
	case "yaml", "json":
		output = groupMetadata(info)
	default:
		{
			sort.Sort(metadataInfos(info))
			output = info
		}
	}
	return c.out.Write(ctx, output)
}
67066
func (s *StepAttachParallelsTools) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction {
	driver := state.Get("driver").(Driver)
	ui := state.Get("ui").(packer.Ui)
	vmName := state.Get("vmName").(string)

	// If we're not attaching the guest additions then just return
	if s.ParallelsToolsMode != ParallelsToolsModeAttach {
		log.Println("Not attaching parallels tools since we're uploading.")
		return multistep.ActionContinue
	}

	// Get the Parallels Tools path on the host machine
	parallelsToolsPath := state.Get("parallels_tools_path").(string)

	// Attach the guest additions to the computer
	ui.Say("Attaching Parallels Tools ISO to the new CD/DVD drive...")

	cdrom, err := driver.DeviceAddCDROM(vmName, parallelsToolsPath)

	if err != nil {
		err = fmt.Errorf("Error attaching Parallels Tools ISO: %s", err)
		state.Put("error", err)
		ui.Error(err.Error())
		return multistep.ActionHalt
	}

	// Track the device name so that we can can delete later
	s.cdromDevice = cdrom

	return multistep.ActionContinue
}
1346561
func (ar *allocRunner) Run() {
	// Close the wait channel on return
	defer close(ar.waitCh)

	// Start the task state update handler
	go ar.handleTaskStateUpdates()

	// Start the alloc update handler
	go ar.handleAllocUpdates()

	// If task update chan has been closed, that means we've been shutdown.
	select {
	case <-ar.taskStateUpdateHandlerCh:
		return
	default:
	}

	// Run the prestart hooks if non-terminal
	if ar.shouldRun() {
		if err := ar.prerun(); err != nil {
			ar.logger.Error("prerun failed", "error", err)
			goto POST
		}
	}

	// Run the runners (blocks until they exit)
	ar.runTasks()

POST:
	// Run the postrun hooks
	if err := ar.postrun(); err != nil {
		ar.logger.Error("postrun failed", "error", err)
	}

}
1094705
func (c *listCommand) Run(ctx *cmd.Context) (err error) {
	api, err := c.newAPIFunc()
	if err != nil {
		return err
	}
	defer api.Close()

	params := GetCombinedStorageInfoParams{
		Context: ctx, APIClient: api, Ids: c.ids,
	}
	switch {
	case c.filesystem:
		params.WantFilesystems = true
	case c.volume:
		params.WantVolumes = true
	default:
		params.WantStorage = true
		params.WantVolumes = true
		params.WantFilesystems = true
	}

	combined, err := GetCombinedStorageInfo(params)
	if err != nil {
		return err
	}
	if combined.Empty() {
		if c.out.Name() == "tabular" {
			ctx.Infof("No storage to display.")
		}
		return nil
	}
	return c.out.Write(ctx, *combined)
}
980116
func (e *MirrorSecrets) Run(c *fi.Context) error {
	return fi.DefaultDeltaRunMethod(e, c)
}
941904
func (c *ReloadCommand) Run(ctx *cmd.Context) error {
	return c.RunWithAPI(ctx, func(api SpaceAPI, ctx *cmd.Context) error {
		err := api.ReloadSpaces()
		if err != nil {
			if errors.IsNotSupported(err) {
				ctx.Infof("cannot reload spaces: %v", err)
			}
			return errors.Annotate(err, "cannot reload spaces")
		}
		return nil
	})
}
408192
func (m *Mux) Run(phase string, ctx *c.Context) *c.Context {
	return m.Middleware.Run(phase, ctx)
}
413300
func (c *listCommand) Run(ctx *cmd.Context) (err error) {
	if c.out.Name() == "tabular" {
		// Only the tabular outputters need to know the current user,
		// but both of them do, so do it in one place.
		accountDetails, err := c.CurrentAccountDetails()
		if err != nil {
			return err
		}
		c.currentUser = names.NewUserTag(accountDetails.User).Id()
	}
	if c.modelName == "" {
		return c.controllerUsers(ctx)
	}
	return c.modelUsers(ctx)
}
1085065
func (c *dumpCommand) Run(ctx *cmd.Context) error {
	client, err := c.getAPI()
	if err != nil {
		return err
	}
	defer client.Close()

	_, modelDetails, err := c.ModelCommandBase.ModelDetails()
	if err != nil {
		return errors.Annotate(err, "getting model details")
	}

	modelTag := names.NewModelTag(modelDetails.ModelUUID)
	results, err := client.DumpModel(modelTag, c.simplified)
	if err != nil {
		return err
	}

	return c.out.Write(ctx, results)
}
663118
func (c *CharmResourcesCommand) Run(ctx *cmd.Context) error {
	return c.baseRun(ctx)
}
692712
func (c *showModelCommand) Run(ctx *cmd.Context) error {
	controllerName, err := c.ControllerName()
	if err != nil {
		return errors.Trace(err)
	}
	_, modelDetails, err := c.ModelDetails()
	if err != nil {
		return errors.Trace(err)
	}
	modelTag := names.NewModelTag(modelDetails.ModelUUID)

	api, err := c.getAPI()
	if err != nil {
		return err
	}
	defer api.Close()

	results, err := api.ModelInfo([]names.ModelTag{modelTag})
	if err != nil {
		return err
	}
	if results[0].Error != nil {
		return results[0].Error
	}
	infoMap, err := c.apiModelInfoToModelInfoMap([]params.ModelInfo{*results[0].Result}, controllerName)
	if err != nil {
		return errors.Trace(err)
	}
	return c.out.Write(ctx, infoMap)
}