Esempio n. 1
0
        private IEnumerable<ItemType> CreateSmfItemWithErrorStatus(OVAL.Definitions.EntitySimpleBaseType fmriEntity)
        {
            var newItemWithErrorStatus = new smf_item()
            {
                status = StatusEnumeration.error,
                message = MessageType.FromErrorString(String.Format(NOT_SUPPORTED_OPERATION_MESSAGE, fmriEntity.operation.ToString())),
                fmri = new EntityItemStringType() { status = StatusEnumeration.error }
            };


            return new ItemType[] { newItemWithErrorStatus };
        }
Esempio n. 2
0
        public IEnumerable<ItemType> GetItemsToCollect(OVAL.Definitions.ObjectType objectType, VariablesEvaluated variables)
        {
            var fmriEntity = ((OVAL.Definitions.Solaris.smf_object)objectType).GetFmriEntity();

            if (fmriEntity.operation != OperationEnumeration.equals)
                return CreateSmfItemWithErrorStatus(fmriEntity);

            var fmriValues = new VariableEntityEvaluator(variables).EvaluateVariableForEntity(fmriEntity);
            var itemsToCollect = new List<ItemType>();
            foreach(var fmriValue in fmriValues)
            {
                var newSmfItem = new smf_item() { fmri = OvalHelper.CreateItemEntityWithStringValue(fmriValue) };
                itemsToCollect.Add(newSmfItem);
            }

            return itemsToCollect;
        }
Esempio n. 3
0
 private void AssertSmfItem(smf_item smfItem, String expectedFmriValue)
 {
     ItemTypeEntityChecker.AssertItemTypeEntity(smfItem.fmri, expectedFmriValue);
 }