func (testRunner *TestRunner) ConfigUEs(numUEs int) ([]*cwfprotos.UEConfig, error) {
	fmt.Printf("************************* Configuring %d UE(s)\n", numUEs)
	ues := make([]*cwfprotos.UEConfig, 0)
	for i := 0; i < numUEs; i++ {
		imsi := ""
		for {
			imsi = getRandomIMSI()
			_, present := testRunner.imsis[imsi]
			if !present {
				break
			}
		}
		key, opc, err := getRandKeyOpcFromOp([]byte(Op))
		if err != nil {
			return nil, err
		}
		seq := getRandSeq()

		ue := makeUE(imsi, key, opc, seq)
		sub := makeSubscriber(imsi, key, opc, seq+1)

		err = uesim.AddUE(ue)
		if err != nil {
			return nil, errors.Wrap(err, "Error adding UE to UESimServer")
		}
		err = addSubscriberToHSS(sub)
		if err != nil {
			return nil, errors.Wrap(err, "Error adding Subscriber to HSS")
		}
		err = addSubscriberToPCRF(sub.GetSid())
		if err != nil {
			return nil, errors.Wrap(err, "Error adding Subscriber to PCRF")
		}
		err = addSubscriberToOCS(sub.GetSid())
		if err != nil {
			return nil, errors.Wrap(err, "Error adding Subscriber to OCS")
		}

		ues = append(ues, ue)
		fmt.Printf("Added UE to Simulator, HSS, PCRF, and OCS:\n"+
			"\tIMSI: %s\tKey: %x\tOpc: %x\tSeq: %d\n", imsi, key, opc, seq)
		testRunner.imsis[imsi] = true
	}
	fmt.Println("Successfully configured UE(s)")
	return ues, nil
}
// ConfigUEs creates and adds the specified number of UEs and Subscribers
// to the UE Simulator and the HSS.
ConfigUEs creates and adds the specified number of UEs and Subscribers
to the UE Simulator and the HSS.
// ConfigUEs creates and adds the specified number of UEs and Subscribers // to the UE Simulator and the HSS .
func (testRunner *TestRunner) ConfigUEs(numUEs int) ([]*cwfprotos.UEConfig, error) {
	fmt.Printf("************************* Configuring %d UE(s)\n", numUEs)
	ues := make([]*cwfprotos.UEConfig, 0)
	for i := 0; i < numUEs; i++ {
		imsi := ""
		for {
			imsi = getRandomIMSI()
			_, present := testRunner.imsis[imsi]
			if !present {
				break
			}
		}
		key, opc, err := getRandKeyOpcFromOp([]byte(Op))
		if err != nil {
			return nil, err
		}
		seq := getRandSeq()
		ue := makeUE(imsi, key, opc, seq)
		sub := makeSubscriber(imsi, key, opc, seq+1)
		err = uesim.AddUE(ue)
		if err != nil {
			return nil, errors.Wrap(err, "Error adding UE to UESimServer")
		}
		err = addSubscriberToHSS(sub)
		if err != nil {
			return nil, errors.Wrap(err, "Error adding Subscriber to HSS")
		}
		err = addSubscriberToPCRF(sub.GetSid())
		if err != nil {
			return nil, errors.Wrap(err, "Error adding Subscriber to PCRF")
		}
		err = addSubscriberToOCS(sub.GetSid())
		if err != nil {
			return nil, errors.Wrap(err, "Error adding Subscriber to OCS")
		}
		ues = append(ues, ue)
		fmt.Printf("Added UE to Simulator, HSS, PCRF, and OCS:\n"+
			"\tIMSI: %s\tKey: %x\tOpc: %x\tSeq: %d\n", imsi, key, opc, seq)
		testRunner.imsis[imsi] = true
	}
	fmt.Println("Successfully configured UE(s)")
	return ues, nil
}
func ( testRunner * TestRunner ) ConfigUEs ( numUEs int ) ( [ ] * cwfprotos . UEConfig , error ) { fmt . Printf ( " \n " , numUEs ) ues := make ( [ ] * cwfprotos . UEConfig , 0 ) for i := 0 ; i < numUEs ; i ++ { imsi := " " for { imsi = getRandomIMSI ( ) _ , present := testRunner . imsis [ imsi ] if ! present { break } } key , opc , err := getRandKeyOpcFromOp ( [ ] byte ( Op ) ) if err != nil { return nil , err } seq := getRandSeq ( ) ue := makeUE ( imsi , key , opc , seq ) sub := makeSubscriber ( imsi , key , opc , seq + 1 ) err = uesim . AddUE ( ue ) if err != nil { return nil , errors . Wrap ( err , " " ) } err = addSubscriberToHSS ( sub ) if err != nil { return nil , errors . Wrap ( err , " " ) } err = addSubscriberToPCRF ( sub . GetSid ( ) ) if err != nil { return nil , errors . Wrap ( err , " " ) } err = addSubscriberToOCS ( sub . GetSid ( ) ) if err != nil { return nil , errors . Wrap ( err , " " ) } ues = append ( ues , ue ) fmt . Printf ( " \n " + " \t \t \t \t \n " , imsi , key , opc , seq ) testRunner . imsis [ imsi ] = true } fmt . Println ( " " ) return ues , nil }
ConfigUEs creates and adds the specified number of UEs and Subscribers
to the UE Simulator and the HSS.
ConfigUEs creates and adds the specified number of UEs and Subscribers to the UE Simulator and the HSS .