From 6b275fe08d44cd86131cfe0bcdc2c91b607c8b03 Mon Sep 17 00:00:00 2001 From: Will Benton <willb@redhat.com> Date: Fri, 22 Jun 2012 19:00:58 -0500 Subject: [PATCH 06/11] Added test case duplicating Matt's failure case. --- spec/skeleton_group_spec.rb | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 42 insertions(+), 1 deletions(-) diff --git a/spec/skeleton_group_spec.rb b/spec/skeleton_group_spec.rb index 838b9a5..839eda6 100644 --- a/spec/skeleton_group_spec.rb +++ b/spec/skeleton_group_spec.rb @@ -63,7 +63,48 @@ module Mrg n.memberships.should_not include(Group::SKELETON_GROUP_NAME) end - + it "should not exhibit Matt's failure case with walkin nodes not getting the skeleton group config" do + default = @store.getDefaultGroup + skel = @store.getSkeletonGroup + + # wallaby add-features-to-group +++DEFAULT Master NodeAccess SharedPort + default.modifyFeatures("ADD", %w{Master NodeAccess SharedPort}, {}) + + # wallaby add-params-to-group +++DEFAULT 'SHARED_PORT_ARGS=-p 9620' 'CONDOR_HOST=$(QMF_BROKER_HOST)' 'ALLOW_WRITE=*' 'ALLOW_READ=*' 'ALLOW_NEGOTIATOR=$(ALLOW_WRITE)' 'ALLOW_NEGOTIATOR_SCHEDD=$(ALLOW_WRITE)' UID_DOMAIN=central-manager + default.modifyParams("ADD", {'SHARED_PORT_ARGS'=>'-p 9620', 'CONDOR_HOST'=>'$(QMF_BROKER_HOST)', 'ALLOW_WRITE'=>'*', 'ALLOW_READ'=>'*', 'ALLOW_NEGOTIATOR'=>'$(ALLOW_WRITE)', 'ALLOW_NEGOTIATOR_SCHEDD'=>'$(ALLOW_WRITE)', 'UID_DOMAIN'=>'central-manager'}, {}) + + # wallaby add-features-to-group +++SKEL ExecuteNode + skel.modifyFeatures("ADD", %w{ExecuteNode}, {}) + + # wallaby add-params-to-group +++SKEL START=TRUE SUSPEND=FALSE + skel.modifyParams("ADD", {'START'=>'TRUE', 'SUSPEND'=>'FALSE'}, {}) + + # wallaby add-node central-manager + cm = @store.addNode('central-manager') + + # wallaby add-param COLLECTOR_UPDATE_INTERVAL (needs to go to base DB) + @store.addParam('COLLECTOR_UPDATE_INTERVAL') + + # wallaby remove-nodes-from-group +++SKEL central-manager + cm.modifyMemberships("REPLACE", cm.memberships - %w{+++SKEL}, {}) + + # wallaby add-features-to-node central-manager CentralManager Scheduler (maybe: JobServer) + cm.identity_group.modifyFeatures("ADD", %w{CentralManager Scheduler JobServer}, {}) + + # wallaby add-params-to-node central-manager COLLECTOR_UPDATE_INTERVAL=15 + cm.identity_group.modifyParams("ADD", {"COLLECTOR_UPDATE_INTERVAL"=>15}) + + # wallaby activate + @store.activateConfiguration.should == [{}, []] + + # newly checked-in nodes should get skeleton group configuration + wi = @store.getNode("walk-in") + wi_config = wi.getConfig("version"=>::Rhubarb::Util::timestamp) + daemons = wi_config["DAEMON_LIST"].split(",").map {|s| s.strip} + daemons.should include("STARTD") + wi_config["START"].should == "TRUE" + wi_config["SUSPEND"].should == "FALSE" + end it "should publish the skeleton group over the API" do @store.getSkeletonGroup.name.should == Group::SKELETON_GROUP_NAME -- 1.7.7.6