~ubuntu-cloud-archive/ubuntu/precise/nova/trunk

« back to all changes in this revision

Viewing changes to nova/tests/scheduler/test_host_filters.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Chuck Short, Soren Hansen
  • Date: 2012-09-07 17:49:53 UTC
  • mfrom: (1.1.61)
  • Revision ID: package-import@ubuntu.com-20120907174953-oapuvix1jxm830he
Tags: 2012.2~rc1~20120907.15996-0ubuntu1
[ Chuck Short ]
* New upstream release.
* debian/nova-common.postinst: Drop nova_sudoers permission changing
  since we do it in the debian/rules. (LP: #995285)

[ Soren Hansen ]
* Update debian/watch to account for symbolically named tarballs and
  use newer URL.
* Fix Launchpad URLs in debian/watch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
from nova import flags
25
25
from nova.openstack.common import jsonutils
26
26
from nova.scheduler import filters
 
27
from nova.scheduler.filters import extra_specs_ops
27
28
from nova.scheduler.filters.trusted_filter import AttestationService
28
29
from nova import test
29
30
from nova.tests.scheduler import fakes
64
65
    pass
65
66
 
66
67
 
 
68
class ExtraSpecsOpsTestCase(test.TestCase):
 
69
    def _do_extra_specs_ops_test(self, value, req, matches):
 
70
        assertion = self.assertTrue if matches else self.assertFalse
 
71
        assertion(extra_specs_ops.match(value, req))
 
72
 
 
73
    def test_extra_specs_matches_simple(self):
 
74
        self._do_extra_specs_ops_test(
 
75
            value='1',
 
76
            req='1',
 
77
            matches=True)
 
78
 
 
79
    def test_extra_specs_fails_simple(self):
 
80
        self._do_extra_specs_ops_test(
 
81
            value='',
 
82
            req='1',
 
83
            matches=False)
 
84
 
 
85
    def test_extra_specs_fails_simple2(self):
 
86
        self._do_extra_specs_ops_test(
 
87
            value='3',
 
88
            req='1',
 
89
            matches=False)
 
90
 
 
91
    def test_extra_specs_fails_simple3(self):
 
92
        self._do_extra_specs_ops_test(
 
93
            value='222',
 
94
            req='2',
 
95
            matches=False)
 
96
 
 
97
    def test_extra_specs_fails_with_bogus_ops(self):
 
98
        self._do_extra_specs_ops_test(
 
99
            value='4',
 
100
            req='> 2',
 
101
            matches=False)
 
102
 
 
103
    def test_extra_specs_matches_with_op_eq(self):
 
104
        self._do_extra_specs_ops_test(
 
105
            value='123',
 
106
            req='= 123',
 
107
            matches=True)
 
108
 
 
109
    def test_extra_specs_matches_with_op_eq2(self):
 
110
        self._do_extra_specs_ops_test(
 
111
            value='124',
 
112
            req='= 123',
 
113
            matches=True)
 
114
 
 
115
    def test_extra_specs_fails_with_op_eq(self):
 
116
        self._do_extra_specs_ops_test(
 
117
            value='34',
 
118
            req='= 234',
 
119
            matches=False)
 
120
 
 
121
    def test_extra_specs_fails_with_op_eq3(self):
 
122
        self._do_extra_specs_ops_test(
 
123
            value='34',
 
124
            req='=',
 
125
            matches=False)
 
126
 
 
127
    def test_extra_specs_matches_with_op_seq(self):
 
128
        self._do_extra_specs_ops_test(
 
129
            value='123',
 
130
            req='s== 123',
 
131
            matches=True)
 
132
 
 
133
    def test_extra_specs_fails_with_op_seq(self):
 
134
        self._do_extra_specs_ops_test(
 
135
            value='1234',
 
136
            req='s== 123',
 
137
            matches=False)
 
138
 
 
139
    def test_extra_specs_matches_with_op_sneq(self):
 
140
        self._do_extra_specs_ops_test(
 
141
            value='1234',
 
142
            req='s!= 123',
 
143
            matches=True)
 
144
 
 
145
    def test_extra_specs_fails_with_op_sneq(self):
 
146
        self._do_extra_specs_ops_test(
 
147
            value='123',
 
148
            req='s!= 123',
 
149
            matches=False)
 
150
 
 
151
    def test_extra_specs_fails_with_op_sge(self):
 
152
        self._do_extra_specs_ops_test(
 
153
            value='1000',
 
154
            req='s>= 234',
 
155
            matches=False)
 
156
 
 
157
    def test_extra_specs_fails_with_op_sle(self):
 
158
        self._do_extra_specs_ops_test(
 
159
            value='1234',
 
160
            req='s<= 1000',
 
161
            matches=False)
 
162
 
 
163
    def test_extra_specs_fails_with_op_sl(self):
 
164
        self._do_extra_specs_ops_test(
 
165
            value='2',
 
166
            req='s< 12',
 
167
            matches=False)
 
168
 
 
169
    def test_extra_specs_fails_with_op_sg(self):
 
170
        self._do_extra_specs_ops_test(
 
171
            value='12',
 
172
            req='s> 2',
 
173
            matches=False)
 
174
 
 
175
    def test_extra_specs_matches_with_op_in(self):
 
176
        self._do_extra_specs_ops_test(
 
177
            value='12311321',
 
178
            req='<in> 11',
 
179
            matches=True)
 
180
 
 
181
    def test_extra_specs_matches_with_op_in2(self):
 
182
        self._do_extra_specs_ops_test(
 
183
            value='12311321',
 
184
            req='<in> 12311321',
 
185
            matches=True)
 
186
 
 
187
    def test_extra_specs_matches_with_op_in3(self):
 
188
        self._do_extra_specs_ops_test(
 
189
            value='12311321',
 
190
            req='<in> 12311321 <in>',
 
191
            matches=True)
 
192
 
 
193
    def test_extra_specs_fails_with_op_in(self):
 
194
        self._do_extra_specs_ops_test(
 
195
            value='12310321',
 
196
            req='<in> 11',
 
197
            matches=False)
 
198
 
 
199
    def test_extra_specs_fails_with_op_in2(self):
 
200
        self._do_extra_specs_ops_test(
 
201
            value='12310321',
 
202
            req='<in> 11 <in>',
 
203
            matches=False)
 
204
 
 
205
    def test_extra_specs_matches_with_op_or(self):
 
206
        self._do_extra_specs_ops_test(
 
207
            value='12',
 
208
            req='<or> 11 <or> 12',
 
209
            matches=True)
 
210
 
 
211
    def test_extra_specs_matches_with_op_or2(self):
 
212
        self._do_extra_specs_ops_test(
 
213
            value='12',
 
214
            req='<or> 11 <or> 12 <or>',
 
215
            matches=True)
 
216
 
 
217
    def test_extra_specs_fails_with_op_or(self):
 
218
        self._do_extra_specs_ops_test(
 
219
            value='13',
 
220
            req='<or> 11 <or> 12',
 
221
            matches=False)
 
222
 
 
223
    def test_extra_specs_fails_with_op_or2(self):
 
224
        self._do_extra_specs_ops_test(
 
225
            value='13',
 
226
            req='<or> 11 <or> 12 <or>',
 
227
            matches=False)
 
228
 
 
229
    def test_extra_specs_matches_with_op_le(self):
 
230
        self._do_extra_specs_ops_test(
 
231
            value='2',
 
232
            req='<= 10',
 
233
            matches=True)
 
234
 
 
235
    def test_extra_specs_fails_with_op_le(self):
 
236
        self._do_extra_specs_ops_test(
 
237
            value='3',
 
238
            req='<= 2',
 
239
            matches=False)
 
240
 
 
241
    def test_extra_specs_matches_with_op_ge(self):
 
242
        self._do_extra_specs_ops_test(
 
243
            value='3',
 
244
            req='>= 1',
 
245
            matches=True)
 
246
 
 
247
    def test_extra_specs_fails_with_op_ge(self):
 
248
        self._do_extra_specs_ops_test(
 
249
            value='2',
 
250
            req='>= 3',
 
251
            matches=False)
 
252
 
 
253
 
67
254
class HostFiltersTestCase(test.TestCase):
68
255
    """Test case for host filters."""
69
256
 
503
690
        assertion = self.assertTrue if passes else self.assertFalse
504
691
        assertion(filt_cls.host_passes(host, filter_properties))
505
692
 
506
 
    def test_compute_filter_passes_extra_specs_simple1(self):
507
 
        self._do_test_compute_filter_extra_specs(
508
 
            ecaps={'opt1': '1', 'opt2': '2'},
509
 
            especs={'opt1': '1'},
510
 
            passes=True)
511
 
 
512
 
    def test_compute_filter_passes_extra_specs_simple2(self):
513
 
        self._do_test_compute_filter_extra_specs(
514
 
            ecaps={'opt1': '1', 'opt2': '2'},
515
 
            especs={'opt1': '1', 'opt2': '2'},
516
 
            passes=True)
517
 
 
518
 
    def test_compute_filter_fails_extra_specs_simple1(self):
519
 
        self._do_test_compute_filter_extra_specs(
520
 
            ecaps={'opt1': '1', 'opt2': '2'},
521
 
            especs={'opt1': '1111'},
522
 
            passes=False)
523
 
 
524
 
    def test_compute_filter_fails_extra_specs_simple2(self):
525
 
        self._do_test_compute_filter_extra_specs(
526
 
            ecaps={'opt1': '1', 'opt2': '2'},
527
 
            especs={'opt1': ''},
528
 
            passes=False)
529
 
 
530
 
    def test_compute_filter_fails_extra_specs_simple3(self):
531
 
        self._do_test_compute_filter_extra_specs(
532
 
            ecaps={'opt1': '1', 'opt2': '2'},
533
 
            especs={'opt3': '3'},
534
 
            passes=False)
535
 
 
536
 
    def test_compute_filter_fails_extra_specs_simple4(self):
537
 
        self._do_test_compute_filter_extra_specs(
538
 
            ecaps={'opt1': '1', 'opt2': '2'},
539
 
            especs={'opt1': '1', 'opt2': '222'},
540
 
            passes=False)
541
 
 
542
 
    def test_compute_filter_fails_extra_specs_simple5(self):
543
 
        self._do_test_compute_filter_extra_specs(
544
 
            ecaps={'opt1': '1', 'opt2': '2'},
545
 
            especs={'opt1': '1111', 'opt2': '222'},
546
 
            passes=False)
547
 
 
548
 
    def test_compute_filter_fails_extra_specs_with_bogus_ops(self):
549
 
        self._do_test_compute_filter_extra_specs(
550
 
            ecaps={'opt1': '2', 'opt2': '5'},
551
 
            especs={'opt1': '> 4', 'opt2': '< 3'},
552
 
            passes=False)
553
 
 
554
 
    def test_compute_filter_passes_extra_specs_with_op_eq(self):
555
 
        self._do_test_compute_filter_extra_specs(
556
 
            ecaps={'opt1': '123'},
557
 
            especs={'opt1': '= 123'},
558
 
            passes=True)
559
 
 
560
 
    def test_compute_filter_passes_extra_specs_with_op_eq2(self):
561
 
        self._do_test_compute_filter_extra_specs(
562
 
            ecaps={'opt1': '124'},
563
 
            especs={'opt1': '= 123'},
564
 
            passes=True)
565
 
 
566
 
    def test_compute_filter_passes_extra_specs_with_op_eq3(self):
567
 
        self._do_test_compute_filter_extra_specs(
568
 
            ecaps={'opt1': '124', 'opt2': '456'},
569
 
            especs={'opt1': '= 123', 'opt2': '= 456'},
570
 
            passes=True)
571
 
 
572
 
    def test_compute_filter_fails_extra_specs_with_op_eq(self):
573
 
        self._do_test_compute_filter_extra_specs(
574
 
            ecaps={'opt2': '34'},
575
 
            especs={'opt2': '= 234'},
576
 
            passes=False)
577
 
 
578
 
    def test_compute_filter_passes_extra_specs_with_op_eq2(self):
579
 
        self._do_test_compute_filter_extra_specs(
580
 
            ecaps={'opt1': '124', 'opt2': '4567'},
581
 
            especs={'opt1': '= 123', 'opt2': '= 456'},
582
 
            passes=True)
583
 
 
584
 
    def test_compute_filter_fails_extra_specs_with_op_eq3(self):
585
 
        self._do_test_compute_filter_extra_specs(
586
 
            ecaps={'opt1': '124'},
587
 
            especs={'opt1': '='},
588
 
            passes=False)
589
 
 
590
 
    def test_compute_filter_fails_extra_specs_with_op_eq4(self):
591
 
        self._do_test_compute_filter_extra_specs(
592
 
            ecaps={'opt3': '124', 'opt4': '456'},
593
 
            especs={'opt11': '= 124', 'opt12': '= 456'},
594
 
            passes=False)
595
 
 
596
 
    def test_compute_filter_passes_extra_specs_with_op_seq(self):
597
 
        self._do_test_compute_filter_extra_specs(
598
 
            ecaps={'opt1': '123'},
599
 
            especs={'opt1': 's== 123'},
600
 
            passes=True)
601
 
 
602
 
    def test_compute_filter_fails_extra_specs_with_op_seq(self):
603
 
        self._do_test_compute_filter_extra_specs(
604
 
            ecaps={'opt2': '2345'},
605
 
            especs={'opt2': 's== 234'},
606
 
            passes=False)
607
 
 
608
 
    def test_compute_filter_passes_extra_specs_with_op_sneq(self):
609
 
        self._do_test_compute_filter_extra_specs(
610
 
            ecaps={'opt1': '11'},
611
 
            especs={'opt1': 's!= 123'},
612
 
            passes=True)
613
 
 
614
 
    def test_compute_filter_fails_extra_specs_with_op_sneq(self):
615
 
        self._do_test_compute_filter_extra_specs(
616
 
            ecaps={'opt2': '234'},
617
 
            especs={'opt2': 's!= 234'},
618
 
            passes=False)
619
 
 
620
 
    def test_compute_filter_passes_extra_specs_with_op_sgle(self):
621
 
        self._do_test_compute_filter_extra_specs(
622
 
            ecaps={'opt1': '11', 'opt2': '543'},
623
 
            especs={'opt1': 's<= 123', 'opt2': 's>= 43'},
624
 
            passes=True)
625
 
 
626
 
    def test_compute_filter_fails_extra_specs_with_op_sge(self):
627
 
        self._do_test_compute_filter_extra_specs(
628
 
            ecaps={'opt2': '1000'},
629
 
            especs={'opt2': 's>= 234'},
630
 
            passes=False)
631
 
 
632
 
    def test_compute_filter_fails_extra_specs_with_op_sle(self):
633
 
        self._do_test_compute_filter_extra_specs(
634
 
            ecaps={'opt2': '234'},
635
 
            especs={'opt2': 's<= 1000'},
636
 
            passes=False)
637
 
 
638
 
    def test_compute_filter_passes_extra_specs_with_op_sgl(self):
639
 
        self._do_test_compute_filter_extra_specs(
640
 
            ecaps={'opt1': '11', 'opt2': '543'},
641
 
            especs={'opt1': 's< 123', 'opt2': 's> 43'},
642
 
            passes=True)
643
 
 
644
 
    def test_compute_filter_fails_extra_specs_with_op_sl(self):
645
 
        self._do_test_compute_filter_extra_specs(
646
 
            ecaps={'opt2': '2'},
647
 
            especs={'opt2': 's< 12'},
648
 
            passes=False)
649
 
 
650
 
    def test_compute_filter_fails_extra_specs_with_op_sg(self):
651
 
        self._do_test_compute_filter_extra_specs(
652
 
            ecaps={'opt2': '12'},
653
 
            especs={'opt2': 's> 2'},
654
 
            passes=False)
655
 
 
656
 
    def test_compute_filter_passes_extra_specs_with_op_in(self):
657
 
        self._do_test_compute_filter_extra_specs(
658
 
            ecaps={'opt1': '12311321'},
659
 
            especs={'opt1': '<in> 11'},
660
 
            passes=True)
661
 
 
662
 
    def test_compute_filter_passes_extra_specs_with_op_in2(self):
663
 
        self._do_test_compute_filter_extra_specs(
664
 
            ecaps={'opt1': '12311321'},
665
 
            especs={'opt1': '<in> 12311321'},
666
 
            passes=True)
667
 
 
668
 
    def test_compute_filter_passes_extra_specs_with_op_in3(self):
669
 
        self._do_test_compute_filter_extra_specs(
670
 
            ecaps={'opt1': '12311321'},
671
 
            especs={'opt1': '<in> 12311321 <in>'},
672
 
            passes=True)
673
 
 
674
 
    def test_compute_filter_fails_extra_specs_with_op_in(self):
675
 
        self._do_test_compute_filter_extra_specs(
676
 
            ecaps={'opt1': '12310321'},
677
 
            especs={'opt1': '<in> 11'},
678
 
            passes=False)
679
 
 
680
 
    def test_compute_filter_fails_extra_specs_with_op_in2(self):
681
 
        self._do_test_compute_filter_extra_specs(
682
 
            ecaps={'opt1': '12310321'},
683
 
            especs={'opt1': '<in> 11 <in>'},
684
 
            passes=False)
685
 
 
686
 
    def test_compute_filter_passes_extra_specs_with_op_or(self):
687
 
        self._do_test_compute_filter_extra_specs(
688
 
            ecaps={'opt1': '12'},
689
 
            especs={'opt1': '<or> 11 <or> 12'},
690
 
            passes=True)
691
 
 
692
 
    def test_compute_filter_passes_extra_specs_with_op_or2(self):
693
 
        self._do_test_compute_filter_extra_specs(
694
 
            ecaps={'opt1': '12'},
695
 
            especs={'opt1': '<or> 11 <or> 12 <or>'},
696
 
            passes=True)
697
 
 
698
 
    def test_compute_filter_fails_extra_specs_with_op_or(self):
699
 
        self._do_test_compute_filter_extra_specs(
700
 
            ecaps={'opt1': '13'},
701
 
            especs={'opt1': '<or> 11 <or> 12'},
702
 
            passes=False)
703
 
 
704
 
    def test_compute_filter_fails_extra_specs_with_op_or2(self):
705
 
        self._do_test_compute_filter_extra_specs(
706
 
            ecaps={'opt1': '13'},
707
 
            especs={'opt1': '<or> 11 <or> 12 <or>'},
708
 
            passes=False)
709
 
 
710
 
    def test_compute_filter_passes_extra_specs_with_op_le(self):
711
 
        self._do_test_compute_filter_extra_specs(
712
 
            ecaps={'opt1': 2, 'opt2': 2},
713
 
            especs={'opt1': '<= 10', 'opt2': '<= 20'},
714
 
            passes=True)
715
 
 
716
 
    def test_compute_filter_fails_extra_specs_with_op_le(self):
717
 
        self._do_test_compute_filter_extra_specs(
718
 
            ecaps={'opt1': 1, 'opt2': 3},
719
 
            especs={'opt1': '<= 2', 'opt2': '<= 2'},
720
 
            passes=False)
721
 
 
722
 
    def test_compute_filter_passes_extra_specs_with_op_ge(self):
723
 
        self._do_test_compute_filter_extra_specs(
724
 
            ecaps={'opt1': 2, 'opt2': 2},
725
 
            especs={'opt1': '>= 1', 'opt2': '>= 2'},
726
 
            passes=True)
727
 
 
728
 
    def test_compute_filter_fails_extra_specs_with_op_ge(self):
729
 
        self._do_test_compute_filter_extra_specs(
730
 
            ecaps={'opt1': 1, 'opt2': 2},
731
 
            especs={'opt1': '>= 2', 'opt2': '>= 2'},
 
693
    def test_compute_filter_passes_extra_specs_simple(self):
 
694
        self._do_test_compute_filter_extra_specs(
 
695
            ecaps={'opt1': '1', 'opt2': '2'},
 
696
            especs={'opt1': '1', 'opt2': '2', 'trust:trusted_host': 'true'},
 
697
            passes=True)
 
698
 
 
699
    def test_compute_filter_fails_extra_specs_simple(self):
 
700
        self._do_test_compute_filter_extra_specs(
 
701
            ecaps={'opt1': '1', 'opt2': '2'},
 
702
            especs={'opt1': '1', 'opt2': '222', 'trust:trusted_host': 'true'},
732
703
            passes=False)
733
704
 
734
705
    def test_aggregate_filter_passes_no_extra_specs(self):
752
723
            db.aggregate_host_add(self.context.elevated(), result.id, host)
753
724
        return result
754
725
 
755
 
    def test_aggregate_filter_passes_extra_specs(self):
756
 
        self._stub_service_is_up(True)
757
 
        filt_cls = self.class_map['AggregateInstanceExtraSpecsFilter']()
758
 
        extra_specs = {'opt1': '1', 'opt2': '2'}
759
 
        self._create_aggregate_with_host(metadata={'opt1': '1'})
760
 
        self._create_aggregate_with_host(name='fake2', metadata={'opt2': '2'})
761
 
 
762
 
        filter_properties = {'context': self.context, 'instance_type':
763
 
                {'memory_mb': 1024, 'extra_specs': extra_specs}}
764
 
        host = fakes.FakeHostState('host1', 'compute', {'free_ram_mb': 1024})
765
 
        self.assertTrue(filt_cls.host_passes(host, filter_properties))
766
 
 
767
 
    def test_aggregate_filter_fails_extra_specs(self):
768
 
        self._stub_service_is_up(True)
769
 
        filt_cls = self.class_map['AggregateInstanceExtraSpecsFilter']()
770
 
        extra_specs = {'opt1': 1, 'opt2': 3}
771
 
        self._create_aggregate_with_host(metadata={'opt1': '1'})
772
 
        self._create_aggregate_with_host(name='fake2', metadata={'opt2': '2'})
773
 
        filter_properties = {'context': self.context, 'instance_type':
774
 
                {'memory_mb': 1024, 'extra_specs': extra_specs}}
775
 
        host = fakes.FakeHostState('host1', 'compute', {'free_ram_mb': 1024})
776
 
        self.assertFalse(filt_cls.host_passes(host, filter_properties))
 
726
    def _do_test_aggregate_filter_extra_specs(self, emeta, especs, passes):
 
727
        self._stub_service_is_up(True)
 
728
        filt_cls = self.class_map['AggregateInstanceExtraSpecsFilter']()
 
729
        self._create_aggregate_with_host(name='fake2', metadata=emeta)
 
730
        filter_properties = {'context': self.context,
 
731
            'instance_type': {'memory_mb': 1024, 'extra_specs': especs}}
 
732
        host = fakes.FakeHostState('host1', 'compute', {'free_ram_mb': 1024})
 
733
        assertion = self.assertTrue if passes else self.assertFalse
 
734
        assertion(filt_cls.host_passes(host, filter_properties))
777
735
 
778
736
    def test_aggregate_filter_fails_extra_specs_deleted_host(self):
779
737
        self._stub_service_is_up(True)
780
738
        filt_cls = self.class_map['AggregateInstanceExtraSpecsFilter']()
781
 
        extra_specs = {'opt1': '1', 'opt2': '2'}
 
739
        extra_specs = {'opt1': 's== 1', 'opt2': 's== 2',
 
740
                       'trust:trusted_host': 'true'}
782
741
        self._create_aggregate_with_host(metadata={'opt1': '1'})
783
742
        agg2 = self._create_aggregate_with_host(name='fake2',
784
743
                metadata={'opt2': '2'})
788
747
        db.aggregate_host_delete(self.context.elevated(), agg2.id, 'host1')
789
748
        self.assertFalse(filt_cls.host_passes(host, filter_properties))
790
749
 
 
750
    def test_aggregate_filter_passes_extra_specs_simple(self):
 
751
        self._do_test_aggregate_filter_extra_specs(
 
752
            emeta={'opt1': '1', 'opt2': '2'},
 
753
            especs={'opt1': '1', 'opt2': '2',
 
754
                    'trust:trusted_host': 'true'},
 
755
            passes=True)
 
756
 
 
757
    def test_aggregate_filter_fails_extra_specs_simple(self):
 
758
        self._do_test_aggregate_filter_extra_specs(
 
759
            emeta={'opt1': '1', 'opt2': '2'},
 
760
            especs={'opt1': '1', 'opt2': '222',
 
761
                    'trust:trusted_host': 'true'},
 
762
            passes=False)
 
763
 
791
764
    def test_isolated_hosts_fails_isolated_on_non_isolated(self):
792
765
        self.flags(isolated_images=['isolated'], isolated_hosts=['isolated'])
793
766
        filt_cls = self.class_map['IsolatedHostsFilter']()
1146
1119
        DATA = '{"hosts":[{"host_name":"host1","trust_lvl":"trusted"}]}'
1147
1120
        self._stub_service_is_up(True)
1148
1121
        filt_cls = self.class_map['TrustedFilter']()
1149
 
        extra_specs = {'trusted_host': 'trusted'}
 
1122
        extra_specs = {'trust:trusted_host': 'trusted'}
1150
1123
        filter_properties = {'instance_type': {'memory_mb': 1024,
1151
1124
                                               'extra_specs': extra_specs}}
1152
1125
        host = fakes.FakeHostState('host1', 'compute', {})
1157
1130
        DATA = '{"hosts":[{"host_name":"host1","trust_lvl":"untrusted"}]}'
1158
1131
        self._stub_service_is_up(True)
1159
1132
        filt_cls = self.class_map['TrustedFilter']()
1160
 
        extra_specs = {'trusted_host': 'trusted'}
 
1133
        extra_specs = {'trust:trusted_host': 'trusted'}
1161
1134
        filter_properties = {'instance_type': {'memory_mb': 1024,
1162
1135
                                               'extra_specs': extra_specs}}
1163
1136
        host = fakes.FakeHostState('host1', 'compute', {})
1168
1141
        DATA = '{"hosts":[{"host_name":"host1","trust_lvl":"trusted"}]}'
1169
1142
        self._stub_service_is_up(True)
1170
1143
        filt_cls = self.class_map['TrustedFilter']()
1171
 
        extra_specs = {'trusted_host': 'untrusted'}
 
1144
        extra_specs = {'trust:trusted_host': 'untrusted'}
1172
1145
        filter_properties = {'instance_type': {'memory_mb': 1024,
1173
1146
                                               'extra_specs': extra_specs}}
1174
1147
        host = fakes.FakeHostState('host1', 'compute', {})
1179
1152
        DATA = '{"hosts":[{"host_name":"host1","trust_lvl":"untrusted"}]}'
1180
1153
        self._stub_service_is_up(True)
1181
1154
        filt_cls = self.class_map['TrustedFilter']()
1182
 
        extra_specs = {'trusted_host': 'untrusted'}
 
1155
        extra_specs = {'trust:trusted_host': 'untrusted'}
1183
1156
        filter_properties = {'instance_type': {'memory_mb': 1024,
1184
1157
                                               'extra_specs': extra_specs}}
1185
1158
        host = fakes.FakeHostState('host1', 'compute', {})