← Back to team overview

maas-builds team mailing list archive

api_tests - Build # 1 - Failure! - Built with lp:~brendan-donegan/maas/api_tests (revno: -1) and lp:~maas-maintainers/maas/packaging (revno: -1)

 

Built with lp:~brendan-donegan/maas/api_tests (revno: -1) and lp:~maas-maintainers/maas/packaging (revno: -1)

See http://162.213.35.104:8080/job/api_tests/1/

[...truncated 10065 lines...]
Synchronizing apps without migrations:
  Creating tables...
    Running deferred SQL...
  Installing custom SQL...
Running migrations:
  Rendering model states... DONE
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying auth.0002_auto_20151119_1629... OK
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying piston3.0001_initial... OK
  Applying maasserver.0001_initial... OK
  Applying maasserver.0002_remove_candidate_name_model... OK
  Applying maasserver.0003_add_node_type_to_node... OK
  Applying maasserver.0004_migrate_installable_to_node_type... OK
  Applying maasserver.0005_delete_installable_from_node... OK
  Applying maasserver.0006_add_lease_time_to_staticipaddress... OK
  Applying maasserver.0007_create_node_proxy_models... OK
  Applying maasserver.0008_use_new_arrayfield... OK
  Applying maasserver.0009_remove_routers_field_from_node... OK
  Applying maasserver.0010_add_dns_models... OK
  Applying maasserver.0011_domain_data... OK
  Applying maasserver.0012_drop_dns_fields... OK
  Applying maasserver.0013_remove_boot_type_from_node... OK
  Applying maasserver.0014_add_region_models... OK
  Applying maasserver.0015_add_bmc_model... OK
  Applying maasserver.0016_migrate_power_data_node_to_bmc... OK
  Applying maasserver.0017_remove_node_power_type... OK
  Applying maasserver.0018_add_dnsdata... OK
  Applying maasserver.0019_add_iprange... OK
  Applying maasserver.0020_nodegroup_to_rackcontroller... OK
  Applying maasserver.0021_nodegroupinterface_to_iprange... OK
  Applying maasserver.0022_extract_ip_for_bmcs... OK
  Applying maasserver.0023_add_ttl_field... OK
  Applying maasserver.0024_remove_nodegroupinterface... OK
  Applying maasserver.0025_create_node_system_id_sequence... OK
  Applying maasserver.0026_create_zone_serial_sequence... OK
  Applying maasserver.0027_replace_static_range_with_admin_reserved_ranges... OK
  Applying maasserver.0028_update_default_vlan_on_interface_and_subnet... OK
  Applying maasserver.0029_add_rdns_mode... OK
  Applying maasserver.0030_drop_all_old_funcs... OK
  Applying maasserver.0031_add_region_rack_rpc_conn_model... OK
  Applying maasserver.0032_loosen_vlan... OK
  Applying maasserver.0033_iprange_minor_changes... OK
  Applying maasserver.0034_rename_mount_params_as_mount_options... OK
  Applying maasserver.0035_convert_ether_wake_to_manual_power_type... OK
  Applying maasserver.0036_add_service_model... OK
  Applying maasserver.0037_node_last_image_sync... OK
  Applying maasserver.0038_filesystem_ramfs_tmpfs_support... OK
  Applying maasserver.0039_create_template_and_versionedtextfile_models... OK
  Applying maasserver.0040_fix_id_seq... OK
  Applying maasserver.0041_change_bmc_on_delete_to_set_null... OK
  Applying maasserver.0042_add_routable_rack_controllers_to_bmc... OK
  Applying maasserver.0043_dhcpsnippet... OK
  Applying maasserver.0044_remove_di_bootresourcefiles... OK
  Applying maasserver.0045_add_node_to_filesystem... OK
  Applying maasserver.0046_add_bridge_interface_type... OK
  Applying maasserver.0047_fix_spelling_of_degraded... OK
  Applying maasserver.0048_add_subnet_allow_proxy... OK
  Applying maasserver.0049_add_external_dhcp_present_to_vlan... OK
  Applying maasserver.0050_modify_external_dhcp_on_vlan... OK
  Applying maasserver.0051_space_fabric_unique... OK
  Applying maasserver.0052_add_codename_title_eol_to_bootresourcecache... OK
  Applying maasserver.0053_add_ownerdata_model... OK
  Applying maasserver.0054_controller... OK
  Applying maasserver.0055_dns_publications... OK
  Applying maasserver.0056_zone_serial_ownership... OK
  Applying maasserver.0057_initial_dns_publication... OK
  Applying maasserver.0058_bigger_integer_for_dns_publication_serial... OK
  Applying maasserver.0056_add_description_to_fabric_and_space... OK
  Applying maasserver.0057_merge... OK
  Applying maasserver.0059_merge... OK
  Applying maasserver.0060_amt_remove_mac_address... OK
  Applying maasserver.0061_maas_nodegroup_worker_to_maas... OK
  Applying maasserver.0062_fix_bootsource_daily_label... OK
  Applying maasserver.0063_remove_orphaned_bmcs_and_ips... OK
  Applying maasserver.0064_remove_unneeded_event_triggers... OK
  Applying maasserver.0065_larger_osystem_and_distro_series... OK
  Applying maasserver.0066_allow_squashfs... OK
  Applying maasserver.0067_add_size_to_largefile... OK
  Applying maasserver.0068_drop_node_system_id_sequence... OK
  Applying maasserver.0069_add_previous_node_status_to_node... OK
  Applying maasserver.0070_allow_null_vlan_on_interface... OK
  Applying maasserver.0071_ntp_server_to_ntp_servers... OK
  Applying metadataserver.0001_initial... OK
  Applying piston3.0002_auto_20151209_1652... OK
  Applying sessions.0001_initial... OK
  Applying sites.0001_initial... OK
Setting up maas (2.1.0~alpha1+bzr5222+5161+512-0ubuntu1) ...
Setting up dh-strip-nondeterminism (0.015-1) ...
Setting up debhelper (9.20160115ubuntu3) ...
Setting up adt-satdep (0) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Processing triggers for systemd (229-4ubuntu7) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
adt-run: DBG: testbed command exited with code 0
adt-run: DBG: testbed command ['dpkg', '--status', 'adt-satdep'], kind short, sout pipe, serr pipe, env []
adt-run: DBG: testbed command exited with code 0
adt-run: DBG: testbed command ['apt-get', '--simulate', '--quiet', '-o', 'APT::Get::Show-User-Simulation-Note=False', '--auto-remove', 'purge', 'adt-satdep'], kind short, sout pipe, serr pipe, env []
adt-run: DBG: testbed command exited with code 0
adt-run: DBG: Marking test dependencies as manually installed: maas maas-region-controller maas-dns maas-region-api apache2 apache2-bin apache2-data apache2-utils maas-rack-controller python3-maas-provisioningserver archdetect-deb authbind bind9 bind9utils bzr python3-django-maas python3-curtin curtin-common dbconfig-pgsql dbconfig-common devscripts python3-sphinx python3-docutils docutils-common python3-sphinx-rtd-theme sphinx-rtd-theme-common fonts-font-awesome fonts-lato python3-formencode formencode-i18n freeipmi-tools libipmidetect0 freeipmi-common python-ipdb ipython maas-dhcp isc-dhcp-server juju juju-2.0 libaprutil1-dbd-sqlite3 libaprutil1-ldap libaprutil1 libapr1 tgt libconfig-general-perl libdebian-installer4 maas-proxy squid libecap3 libipmiconsole2 libfreeipmi16 librdmacm1 libibverbs1 libirs-export141 libirs141 libisccfg-export140 libjs-angularjs sphinx-common libjs-sphinxdoc libjs-jquery libjs-modernizr libjs-underscore libjs-yui3-min libjs-yui3-full libjs-yui3-common libltdl7 liblua5.1-0 sg3-utils libsgutils2-2 linux-headers-4.4.0-22-generic linux-headers-4.4.0-22 linux-image-extra-4.4.0-22-generic linux-image-4.4.0-22-generic maas-cli maas-common pep8 postgresql pxelinux pyflakes python-all python3-seamicroclient python3-babel python-babel-localedata python-oauthlib python-blinker python-bzrlib python-configobj python-paramiko python-crypto python-decorator python3-django-piston3 python3-django python-django-common python-ecdsa python-testtools python-extras python-jwt python-unittest2 python-traceback2 python-linecache2 python-mimeparse python-nose python-parted python-pbr python-pexpect python-pip python-pip-whl python-ptyprocess python-pyflakes python-simplegeneric python-yaml python-zmq python3-alabaster python3-txtftp python3-crochet python3-twisted python3-service-identity python3-attr python3-bson python3-convoy python3-distro-info python3-djorm-ext-pgarray python3-dnspython python3-paramiko python3-ecdsa python3-mock python3-funcsigs python3-maas-client python3-httplib2 python3-iso8601 python3-jsonschema python3-lxml python3-netifaces python3-nose python3-oauth python3-pep8 python3-petname python3-pexpect python3-psycopg2 python3-ptyprocess python3-pyasn1-modules python3-pygments python3-pyparsing python3-pyvmomi python3-roman python3-simplestreams python3-tempita python3-tz python3-zope.interface squid-common squid-langpack syslinux-common ubuntu-cloudimage-keyring
adt-run: DBG: testbed command ['apt-mark', 'manual', '-qq', 'maas', 'maas-region-controller', 'maas-dns', 'maas-region-api', 'apache2', 'apache2-bin', 'apache2-data', 'apache2-utils', 'maas-rack-controller', 'python3-maas-provisioningserver', 'archdetect-deb', 'authbind', 'bind9', 'bind9utils', 'bzr', 'python3-django-maas', 'python3-curtin', 'curtin-common', 'dbconfig-pgsql', 'dbconfig-common'], kind short, sout raw, serr pipe, env []
adt-run: DBG: testbed command exited with code 0
adt-run: DBG: testbed command ['apt-mark', 'manual', '-qq', 'devscripts', 'python3-sphinx', 'python3-docutils', 'docutils-common', 'python3-sphinx-rtd-theme', 'sphinx-rtd-theme-common', 'fonts-font-awesome', 'fonts-lato', 'python3-formencode', 'formencode-i18n', 'freeipmi-tools', 'libipmidetect0', 'freeipmi-common', 'python-ipdb', 'ipython', 'maas-dhcp', 'isc-dhcp-server', 'juju', 'juju-2.0', 'libaprutil1-dbd-sqlite3'], kind short, sout raw, serr pipe, env []
adt-run: DBG: testbed command exited with code 0
adt-run: DBG: testbed command ['apt-mark', 'manual', '-qq', 'libaprutil1-ldap', 'libaprutil1', 'libapr1', 'tgt', 'libconfig-general-perl', 'libdebian-installer4', 'maas-proxy', 'squid', 'libecap3', 'libipmiconsole2', 'libfreeipmi16', 'librdmacm1', 'libibverbs1', 'libirs-export141', 'libirs141', 'libisccfg-export140', 'libjs-angularjs', 'sphinx-common', 'libjs-sphinxdoc', 'libjs-jquery'], kind short, sout raw, serr pipe, env []
adt-run: DBG: testbed command exited with code 0
adt-run: DBG: testbed command ['apt-mark', 'manual', '-qq', 'libjs-modernizr', 'libjs-underscore', 'libjs-yui3-min', 'libjs-yui3-full', 'libjs-yui3-common', 'libltdl7', 'liblua5.1-0', 'sg3-utils', 'libsgutils2-2', 'linux-headers-4.4.0-22-generic', 'linux-headers-4.4.0-22', 'linux-image-extra-4.4.0-22-generic', 'linux-image-4.4.0-22-generic', 'maas-cli', 'maas-common', 'pep8', 'postgresql', 'pxelinux', 'pyflakes', 'python-all'], kind short, sout raw, serr pipe, env []
adt-run: DBG: testbed command exited with code 0
adt-run: DBG: testbed command ['apt-mark', 'manual', '-qq', 'python3-seamicroclient', 'python3-babel', 'python-babel-localedata', 'python-oauthlib', 'python-blinker', 'python-bzrlib', 'python-configobj', 'python-paramiko', 'python-crypto', 'python-decorator', 'python3-django-piston3', 'python3-django', 'python-django-common', 'python-ecdsa', 'python-testtools', 'python-extras', 'python-jwt', 'python-unittest2', 'python-traceback2', 'python-linecache2'], kind short, sout raw, serr pipe, env []
adt-run: DBG: testbed command exited with code 0
adt-run: DBG: testbed command ['apt-mark', 'manual', '-qq', 'python-mimeparse', 'python-nose', 'python-parted', 'python-pbr', 'python-pexpect', 'python-pip', 'python-pip-whl', 'python-ptyprocess', 'python-pyflakes', 'python-simplegeneric', 'python-yaml', 'python-zmq', 'python3-alabaster', 'python3-txtftp', 'python3-crochet', 'python3-twisted', 'python3-service-identity', 'python3-attr', 'python3-bson', 'python3-convoy'], kind short, sout raw, serr pipe, env []
adt-run: DBG: testbed command exited with code 0
adt-run: DBG: testbed command ['apt-mark', 'manual', '-qq', 'python3-distro-info', 'python3-djorm-ext-pgarray', 'python3-dnspython', 'python3-paramiko', 'python3-ecdsa', 'python3-mock', 'python3-funcsigs', 'python3-maas-client', 'python3-httplib2', 'python3-iso8601', 'python3-jsonschema', 'python3-lxml', 'python3-netifaces', 'python3-nose', 'python3-oauth', 'python3-pep8', 'python3-petname', 'python3-pexpect', 'python3-psycopg2', 'python3-ptyprocess'], kind short, sout raw, serr pipe, env []
adt-run: DBG: testbed command exited with code 0
adt-run: DBG: testbed command ['apt-mark', 'manual', '-qq', 'python3-pyasn1-modules', 'python3-pygments', 'python3-pyparsing', 'python3-pyvmomi', 'python3-roman', 'python3-simplestreams', 'python3-tempita', 'python3-tz', 'python3-zope.interface', 'squid-common', 'squid-langpack', 'syslinux-common', 'ubuntu-cloudimage-keyring'], kind short, sout raw, serr pipe, env []
adt-run: DBG: testbed command exited with code 0
adt-run: DBG: testbed command ['dpkg', '--purge', 'adt-satdep'], kind short, sout raw, serr raw, env []
(Reading database ... 152798 files and directories currently installed.)
Removing adt-satdep (0) ...
adt-run: DBG: testbed command exited with code 0
adt-run: DBG: testbed command ['sh', '-ec', '[ -d /var/cache/apparmor -a -d /var/lib/apparmor/clicks -a ! -e /var/cache/apparmor/click-ap.rules ] && type aa-clickhook >/dev/null 2>&1'], kind short, sout raw, serr raw, env []
adt-run: DBG: testbed command exited with code 1
adt-run: DBG: testbed does not have AppArmor/click or already has Autopilot click rules, no need to adjust rules
adt-run: DBG: testbed command ['which', 'dpkg-query'], kind short, sout pipe, serr pipe, env []
adt-run: DBG: testbed command exited with code 0
adt-run: DBG: testbed command ['sh', '-ec', "dpkg-query --show -f '${Package}\\t${Version}\\n' > /tmp/autopkgtest.llqXNB/maas-package-test-packages.all"], kind short, sout raw, serr pipe, env []
adt-run: DBG: testbed command exited with code 0
adt-run: DBG: sending command to testbed: copyup /tmp/autopkgtest.llqXNB/maas-package-test-packages.all /var/lib/jenkins/workspace/api_tests/results/maas-package-test-packages.all
adt-virt-qemu: DBG: executing copyup /tmp/autopkgtest.llqXNB/maas-package-test-packages.all /var/lib/jenkins/workspace/api_tests/results/maas-package-test-packages.all
adt-virt-qemu: DBG: ['cmdls', "(['/tmp/adt-virt-qemu.3v4s_6iv/runcmd', 'sh', '-ec', 'cat </tmp/autopkgtest.llqXNB/maas-package-test-packages.all'], ['cat'])"]
adt-virt-qemu: DBG: ['srcstdin', "<_io.TextIOWrapper name='/dev/null' mode='r' encoding='ANSI_X3.4-1968'>", 'deststdout', "<_io.TextIOWrapper name='/var/lib/jenkins/workspace/api_tests/results/maas-package-test-packages.all' mode='w' encoding='ANSI_X3.4-1968'>", 'devnull_read', <_io.TextIOWrapper name='/dev/null' mode='r' encoding='ANSI_X3.4-1968'>]
adt-virt-qemu: DBG:  +< /tmp/adt-virt-qemu.3v4s_6iv/runcmd sh -ec cat </tmp/autopkgtest.llqXNB/maas-package-test-packages.all
adt-virt-qemu: DBG:  +> cat
adt-virt-qemu: DBG:  +>?
adt-virt-qemu: DBG:  +<?
adt-run: DBG: got reply from testbed: ok
adt-run: DBG: testbed command ['test', '-e', '/tmp/autopkgtest.llqXNB/build.v6h/real-tree'], kind short, sout raw, serr raw, env []
adt-run: DBG: testbed command exited with code 1
adt-run: DBG: testbed command ['mkdir', '-p', '/tmp/autopkgtest.llqXNB/build.v6h'], kind short, sout raw, serr pipe, env []
adt-run: DBG: testbed command exited with code 0
adt-run: DBG: sending command to testbed: copydown /var/lib/jenkins/workspace/api_tests/results/tests-tree/ /tmp/autopkgtest.llqXNB/build.v6h/real-tree/
adt-virt-qemu: DBG: executing copydown /var/lib/jenkins/workspace/api_tests/results/tests-tree/ /tmp/autopkgtest.llqXNB/build.v6h/real-tree/
adt-virt-qemu: DBG: ['cmdls', "(['tar', '--directory', '/var/lib/jenkins/workspace/api_tests/results/tests-tree/', '--warning=none', '-c', '.', '-f', '-'], ['/tmp/adt-virt-qemu.3v4s_6iv/runcmd', 'sh', '-ec', 'if ! test -d /tmp/autopkgtest.llqXNB/build.v6h/real-tree/; then mkdir -- /tmp/autopkgtest.llqXNB/build.v6h/real-tree/; fi; cd /tmp/autopkgtest.llqXNB/build.v6h/real-tree/; tar --warning=none --preserve-permissions --extract --no-same-owner -f -'])"]
adt-virt-qemu: DBG: ['srcstdin', "<_io.TextIOWrapper name='/dev/null' mode='r' encoding='ANSI_X3.4-1968'>", 'deststdout', "<_io.TextIOWrapper name='/dev/null' mode='r' encoding='ANSI_X3.4-1968'>", 'devnull_read', <_io.TextIOWrapper name='/dev/null' mode='r' encoding='ANSI_X3.4-1968'>]
adt-virt-qemu: DBG:  +< tar --directory /var/lib/jenkins/workspace/api_tests/results/tests-tree/ --warning=none -c . -f -
adt-virt-qemu: DBG:  +> /tmp/adt-virt-qemu.3v4s_6iv/runcmd sh -ec if ! test -d /tmp/autopkgtest.llqXNB/build.v6h/real-tree/; then mkdir -- /tmp/autopkgtest.llqXNB/build.v6h/real-tree/; fi; cd /tmp/autopkgtest.llqXNB/build.v6h/real-tree/; tar --warning=none --preserve-permissions --extract --no-same-owner -f -
adt-virt-qemu: DBG:  +>?
adt-virt-qemu: DBG:  +<?
adt-run: DBG: got reply from testbed: ok
adt-run: DBG: testbed command ['chown', '-R', 'ubuntu', '--', '/tmp/autopkgtest.llqXNB/build.v6h/real-tree'], kind short, sout raw, serr pipe, env []
adt-run: DBG: testbed command exited with code 0
adt-run [07:00:00]: test maas-package-test: [-----------------------
adt-run: DBG: testbed command ['su', '-s', '/bin/bash', 'root', '-c', 'set -e; export USER=`id -nu`; . /etc/profile >/dev/null 2>&1 || true;  . ~/.profile >/dev/null 2>&1 || true; buildtree="/tmp/autopkgtest.llqXNB/build.v6h/real-tree"; mkdir -p -m 1777 -- "/tmp/autopkgtest.llqXNB/maas-package-test-artifacts"; export ADT_ARTIFACTS="/tmp/autopkgtest.llqXNB/maas-package-test-artifacts"; mkdir -p -m 755 "/tmp/autopkgtest.llqXNB/adttmp"; export ADTTMP="/tmp/autopkgtest.llqXNB/adttmp" export DEBIAN_FRONTEND=noninteractive; export LANG=C.UTF-8; export DEB_BUILD_OPTIONS=parallel=1; unset LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE   LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS   LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION LC_ALL;rm -f /tmp/adt_test_script_pid; set -C; echo $$ > /tmp/adt_test_script_pid; set +C; trap "rm -f /tmp/adt_test_script_pid" EXIT INT QUIT PIPE; cd "$buildtree"; export ADT_NORMAL_USER=ubuntu; chmod +x /tmp/autopkgtest.llqXNB/build.v6h/real-tree/debian/tests/maas-package-test; touch /tmp/autopkgtest.llqXNB/maas-package-test-stdout /tmp/autopkgtest.llqXNB/maas-package-test-stderr; /tmp/autopkgtest.llqXNB/build.v6h/real-tree/debian/tests/maas-package-test 2> >(tee -a /tmp/autopkgtest.llqXNB/maas-package-test-stderr >&2) > >(tee -a /tmp/autopkgtest.llqXNB/maas-package-test-stdout); '], kind test, sout raw, serr raw, env []
maas-integration.TestMAASIntegration.test_create_admin ... ok
maas-integration.TestMAASIntegration.test_restart_dbus_avahi ... SKIP: Avahi/DBUS are not used anymore
maas-integration.TestMAASIntegration.test_update_maas_url ... ok
maas-integration.TestMAASIntegration.test_restart_provisioning_server_systemctl ... ok
maas-integration.TestMAASIntegration.test_check_initial_services_systemctl ... ok
maas-integration.TestMAASIntegration.test_check_rpc_info ... ok
maas-integration.TestMAASIntegration.test_update_preseed_arm ... SKIP: Don't test ARM nodes
maas-integration.TestMAASIntegration.test_login_api ... ok
maas-integration.TestMAASIntegration.test_maas_logged_in ... ok
maas-integration.TestMAASIntegration.test_set_main_archive ... FAIL
SKIP: Not testing Cluster controller

======================================================================
FAIL: maas-integration.TestMAASIntegration.test_set_main_archive
----------------------------------------------------------------------
testtools.testresult.real._StringException: Empty attachments:
  stderr for maas maas ['maas', 'get-config', 'name=main_archive']
  stderr for maas maas ['maas', 'set-config', 'name=main_archive', 'value=http://us.archive.ubuntu.com/ubuntu']

retcode for maas maas ['maas', 'get-config', 'name=main_archive']: {{{0}}}
retcode for maas maas ['maas', 'set-config', 'name=main_archive', 'value=http://us.archive.ubuntu.com/ubuntu']: {{{0}}}
stdout for maas maas ['maas', 'get-config', 'name=main_archive']: {{{"http://us.archive.ubuntu.com/ubuntu"}}}
stdout for maas maas ['maas', 'set-config', 'name=main_archive', 'value=http://us.archive.ubuntu.com/ubuntu']: {{{OK}}}

Traceback (most recent call last):
  File "/tmp/autopkgtest.llqXNB/build.v6h/real-tree/debian/tests/maas-integration.py", line 586, in test_set_main_archive
    'primary:  ["%s"]' % MAIN_ARCHIVE))
  File "/usr/lib/python3/dist-packages/testtools/testcase.py", line 435, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: 'primary:  ["http://us.archive.ubuntu.com/ubuntu";]' not in '#cloud-config\napt_proxy: http://10.245.136.6:8000/\n\nsystem_info:\n   package_mirrors:\n     - arches: [i386, amd64]\n       search:\n         primary:  ["http://us.archive.ubuntu.com//ubuntu"]\n         security: ["http://us.archive.ubuntu.com//ubuntu"]\n       failsafe:\n         primary:  "http://archive.ubuntu.com/ubuntu"\n         security: "http://security.ubuntu.com/ubuntu"\n     - arches: [default]\n       search:\n         primary:  ["http://ports.ubuntu.com//ubuntu-ports"]\n         security: ["http://ports.ubuntu.com//ubuntu-ports"]\n       failsafe:\n         primary:  "http://ports.ubuntu.com/ubuntu-ports"\n         security: "http://ports.ubuntu.com/ubuntu-ports"\n\nrsyslog:\n   remotes:\n     maas: "10.245.136.6:514"\n\npower_state:\n   delay: now\n   mode: poweroff\n   timeout: 1800\n   condition: test ! -e /tmp/block-poweroff\n\nmisc_bucket:\n - &maas_enlist |\n   ####  IPMI setup  ######\n   # If IPMI network settings have been configured statically, you can\n   # make them DHCP. If \'true\', the IPMI network source will be changed\n   # to DHCP.\n   IPMI_CHANGE_STATIC_TO_DHCP="false"\n\n   # In certain hardware, the parameters for the ipmi_si kernel module\n   # might need to be specified. If you wish to send parameters, uncomment\n   # the following line.\n   #IPMI_SI_PARAMS="type=kcs ports=0xca2"\n\n   TEMP_D=$(mktemp -d "${TMPDIR:-/tmp}/${0##*/}.XXXXXX")\n   IPMI_CONFIG_D="${TEMP_D}/ipmi.d"\n   BIN_D="${TEMP_D}/bin"\n   OUT_D="${TEMP_D}/out"\n   PATH="$BIN_D:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"\n\n   mkdir -p "$BIN_D" "$OUT_D" "$IPMI_CONFIG_D"\n\n   load_modules() {\n      modprobe ipmi_msghandler\n      modprobe ipmi_devintf\n      modprobe ipmi_si ${IPMI_SI_PARAMS}\n      modprobe ipmi_ssif\n      udevadm settle\n   }\n\n   add_bin() {\n      cat > "${BIN_D}/$1"\n      chmod "${2:-755}" "${BIN_D}/$1"\n   }\n   add_ipmi_config() {\n      cat > "${IPMI_CONFIG_D}/$1"\n      chmod "${2:-644}" "${IPMI_CONFIG_D}/$1"\n   }\n\n   # Example config: enable BMC remote access (on some systems.)\n   #add_ipmi_config "02-global-config.ipmi" <<"END_IPMI_CONFIG"\n   #Section Lan_Channel\n   #     Volatile_Access_Mode                    Always_Available\n   #     Volatile_Enable_User_Level_Auth         Yes\n   #     Volatile_Channel_Privilege_Limit        Administrator\n   #     Non_Volatile_Access_Mode                Always_Available\n   #     Non_Volatile_Enable_User_Level_Auth     Yes\n   #     Non_Volatile_Channel_Privilege_Limit    Administrator\n   #EndSection\n   #END_IPMI_CONFIG\n\n   add_bin "maas-ipmi-autodetect-tool" <<"END_MAAS_IPMI_AUTODETECT_TOOL"\n   #!/usr/bin/python3\n   \n   import glob\n   import re\n   import subprocess\n   \n   \n   def detect_ipmi():\n       # XXX: andreserl 2013-04-09 bug=1064527: Try to detect if node\n       # is a Virtual Machine. If it is, do not try to detect IPMI.\n       with open(\'/proc/cpuinfo\', \'r\') as cpuinfo:\n           for line in cpuinfo:\n               if line.startswith(\'model name\') and \'QEMU\' in line:\n                   return (False, None)\n   \n       (status, output) = subprocess.getstatusoutput(\'ipmi-locate\')\n       show_re = re.compile(\'(IPMI\\ Version:) (\\d\\.\\d)\')\n       res = show_re.search(output)\n       if res is None:\n           found = glob.glob("/dev/ipmi[0-9]")\n           if len(found):\n               return (True, "UNKNOWN: %s" % " ".join(found))\n           return (False, "")\n       return (True, res.group(2))\n   \n   \n   def is_host_moonshot():\n       output = subprocess.check_output([\'ipmitool\', \'raw\', \'06\', \'01\'])\n       # 14 is the code that identifies a machine as a moonshot\n       if output.split()[0] == "14":\n           return True\n       return False\n   \n   \n   def main():\n       # Check whether IPMI exists or not.\n       (status, ipmi_version) = detect_ipmi()\n       if not status:\n           # if False, then failed to detect ipmi\n           exit(1)\n   \n       if is_host_moonshot():\n           print("moonshot")\n       else:\n           print("ipmi")\n   \n   \n   if __name__ == \'__main__\':\n       main()\n   END_MAAS_IPMI_AUTODETECT_TOOL\n\n   add_bin "maas-ipmi-autodetect" <<"END_MAAS_IPMI_AUTODETECT"\n   #!/usr/bin/python3\n   #\n   # maas-ipmi-autodetect - autodetect and autoconfigure IPMI.\n   #\n   # Copyright (C) 2013-2016 Canonical\n   #\n   # Authors:\n   #    Andres Rodriguez <andres.rodriguez@xxxxxxxxxxxxx>\n   #\n   # This program is free software: you can redistribute it and/or modify\n   # it under the terms of the GNU Affero General Public License as\n   # published by the Free Software Foundation, version 3 of the License.\n   #\n   # This program is distributed in the hope that it will be useful,\n   # but WITHOUT ANY WARRANTY; without even the implied warranty of\n   # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n   # GNU Affero General Public License for more details.\n   #\n   # You should have received a copy of the GNU Affero General Public License\n   # along with this program.  If not, see <http://www.gnu.org/licenses/>.\n   \n   from collections import OrderedDict\n   import json\n   import os\n   import platform\n   import random\n   import re\n   import string\n   import subprocess\n   import time\n   \n   \n   class IPMIError(Exception):\n       """An error related to IPMI."""\n   \n   \n   def run_command(command_args):\n       """Run a command. Return output if successful or raise exception if not."""\n       output = subprocess.check_output(command_args, stderr=subprocess.STDOUT)\n       return output.decode(\'utf-8\')\n   \n   \n   def bmc_get(key):\n       """Fetch the output of a key via bmc-config checkout."""\n       command = (\'bmc-config\', \'--checkout\', \'--key-pair=%s\' % key)\n       output = run_command(command)\n       return output\n   \n   \n   def bmc_set(key, value):\n       """Set the value of a key via bmc-config commit."""\n       command = (\'bmc-config\', \'--commit\', \'--key-pair=%s=%s\' % (key, value))\n       run_command(command)\n   \n   \n   def format_user_key(user_number, parameter):\n       """Format a user key string."""\n       return \'%s:%s\' % (user_number, parameter)\n   \n   \n   def bmc_user_get(user_number, parameter):\n       """Get a user parameter via bmc-config commit."""\n       key = format_user_key(user_number, parameter)\n       raw = bmc_get(key)\n       pattern = r\'^\\s*%s(?:[ \\t])+([^#\\s]+[^\\n]*)$\' % (re.escape(parameter))\n       match = re.search(pattern, raw, re.MULTILINE)\n       if match is None:\n           return None\n       return match.group(1)\n   \n   \n   def bmc_user_set(user_number, parameter, value):\n       """Set a user parameter via bmc-config commit."""\n       key = format_user_key(user_number, parameter)\n       bmc_set(key, value)\n   \n   \n   def bmc_list_sections():\n       """Retrieve the names of config sections from the BMC."""\n       command = (\'bmc-config\', \'-L\')\n       output = run_command(command)\n       return output\n   \n   \n   def list_user_numbers():\n       """List the user numbers on the BMC."""\n       output = bmc_list_sections()\n       pattern = r\'^(User\\d+)$\'\n       users = re.findall(pattern, output, re.MULTILINE)\n   \n       return users\n   \n   \n   def pick_user_number_from_list(search_username, user_numbers):\n       """Pick the best user number for a user from a list of user numbers.\n   \n       If any any existing user\'s username matches the search username, pick\n       that user.\n   \n       Otherwise, pick the first user that has no username set.\n   \n       If no users match those criteria, raise an IPMIError.\n       """\n       first_unused = None\n   \n       for user_number in user_numbers:\n           # The IPMI spec reserves User1 as anonymous.\n           if user_number == \'User1\':\n               continue\n   \n           username = bmc_user_get(user_number, \'Username\')\n   \n           if username == search_username:\n               return user_number\n   \n           # Usually a BMC won\'t include a Username value if the user is unused.\n           # Some HP BMCs use "(Empty User)" to indicate a user in unused.\n           if username in [None, \'(Empty User)\'] and first_unused is None:\n               first_unused = user_number\n   \n       return first_unused\n   \n   \n   def pick_user_number(search_username):\n       """Pick the best user number for a username."""\n       user_numbers = list_user_numbers()\n       user_number = pick_user_number_from_list(search_username, user_numbers)\n   \n       if not user_number:\n           raise IPMIError(\'No IPMI user slots available.\')\n   \n       return user_number\n   \n   \n   def is_ipmi_dhcp():\n       output = bmc_get(\'Lan_Conf:IP_Address_Source\')\n       show_re = re.compile(\'IP_Address_Source\\s+Use_DHCP\')\n       return show_re.search(output) is not None\n   \n   \n   def set_ipmi_network_source(source):\n       bmc_set(\'Lan_Conf:IP_Address_Source\', source)\n   \n   \n   def get_ipmi_ip_address():\n       output = bmc_get(\'Lan_Conf:IP_Address\')\n       show_re = re.compile(\'([0-9]{1,3}[.]?){4}\')\n       res = show_re.search(output)\n       return res.group()\n   \n   \n   def verify_ipmi_user_settings(user_number, user_settings):\n       """Verify user settings were applied correctly."""\n   \n       bad_values = {}\n   \n       for key, expected_value in user_settings.items():\n           # Password isn\'t included in checkout. Plus,\n           # some older BMCs may not support Enable_User.\n           if key not in [\'Enable_User\', \'Password\']:\n               value = bmc_user_get(user_number, key)\n               if value != expected_value:\n                   bad_values[key] = value\n   \n       if len(bad_values) == 0:\n           return\n   \n       errors_string = \' \'.join([\n           "for \'%s\', expected \'%s\', actual \'%s\';" % (\n               key, user_settings[key], actual_value)\n           for key, actual_value in bad_values.items()\n           ]).rstrip(\';\')\n       message = "IPMI user setting verification failures: %s." % (errors_string)\n       raise IPMIError(message)\n   \n   \n   def apply_ipmi_user_settings(user_settings):\n       """Commit and verify IPMI user settings."""\n       username = user_settings[\'Username\']\n       ipmi_user_number = pick_user_number(username)\n   \n       for key, value in user_settings.items():\n           bmc_user_set(ipmi_user_number, key, value)\n   \n       verify_ipmi_user_settings(ipmi_user_number, user_settings)\n   \n   \n   def make_ipmi_user_settings(username, password):\n       """Factory for IPMI user settings."""\n       # Some BMCs care about the order these settings are applied in.\n       #\n       # - Dell Poweredge R420 Systems require the username and password to\n       # be set prior to the user being enabled.\n       #\n       # - Supermicro systems require the LAN Privilege Limit to be set\n       # prior to enabling LAN IPMI msgs for the user.\n       user_settings = OrderedDict((\n           (\'Username\', username),\n           (\'Password\', password),\n           (\'Enable_User\', \'Yes\'),\n           (\'Lan_Privilege_Limit\', \'Administrator\'),\n           (\'Lan_Enable_IPMI_Msgs\', \'Yes\'),\n       ))\n       return user_settings\n   \n   \n   def configure_ipmi_user(username, password):\n       """Create or configure an IPMI user for remote use."""\n       user_settings = make_ipmi_user_settings(username, password)\n       apply_ipmi_user_settings(user_settings)\n   \n   \n   def commit_ipmi_settings(config):\n       run_command((\'bmc-config\', \'--commit\', \'--filename\', config))\n   \n   \n   def get_maas_power_settings(user, password, ipaddress, version):\n       return "%s,%s,%s,%s" % (user, password, ipaddress, version)\n   \n   \n   def get_maas_power_settings_json(user, password, ipaddress, version):\n       power_params = {\n           "power_address": ipaddress,\n           "power_pass": password,\n           "power_user": user,\n           "power_driver": version,\n       }\n       return json.dumps(power_params)\n   \n   \n   def generate_random_password(min_length=8, max_length=15):\n       length = random.randint(min_length, max_length)\n       letters = string.ascii_letters + string.digits\n       return \'\'.join([random.choice(letters) for _ in range(length)])\n   \n   \n   def bmc_supports_lan2_0():\n       """Detect if BMC supports LAN 2.0."""\n       output = run_command((\'ipmi-locate\'))\n       if \'IPMI Version: 2.0\' in output or platform.machine() == \'ppc64le\':\n           return True\n       return False\n   \n   \n   def main():\n       import argparse\n   \n       parser = argparse.ArgumentParser(\n           description=\'send config file to modify IPMI settings with\')\n       parser.add_argument(\n           "--configdir", metavar="folder", help="specify config file directory",\n           default=None)\n       parser.add_argument(\n           "--dhcp-if-static", action="store_true", dest="dhcp",\n           help="set network source to DHCP if Static", default=False)\n       parser.add_argument(\n           "--commission-creds", action="store_true", dest="commission_creds",\n           help="Create IPMI temporary credentials", default=False)\n   \n       args = parser.parse_args()\n   \n       # Check whether IPMI is being set to DHCP. If it is not, and\n       # \'--dhcp-if-static\' has been passed,  Set it to IPMI to DHCP.\n       if not is_ipmi_dhcp() and args.dhcp:\n           set_ipmi_network_source("Use_DHCP")\n           # allow IPMI 120 seconds to obtain an IP address\n           time.sleep(120)\n       # create user/pass\n       IPMI_MAAS_USER = "maas"\n       IPMI_MAAS_PASSWORD = generate_random_password()\n   \n       configure_ipmi_user(IPMI_MAAS_USER, IPMI_MAAS_PASSWORD)\n   \n       # Commit other IPMI settings\n       if args.configdir:\n           for file in os.listdir(args.configdir):\n               commit_ipmi_settings(os.path.join(args.configdir, file))\n   \n       # get the IP address\n       IPMI_IP_ADDRESS = get_ipmi_ip_address()\n       if IPMI_IP_ADDRESS == "0.0.0.0":\n           # if IPMI_IP_ADDRESS is 0.0.0.0, wait 60 seconds and retry.\n           set_ipmi_network_source("Static")\n           time.sleep(2)\n           set_ipmi_network_source("Use_DHCP")\n           time.sleep(60)\n           IPMI_IP_ADDRESS = get_ipmi_ip_address()\n   \n       if IPMI_IP_ADDRESS is None or IPMI_IP_ADDRESS == "0.0.0.0":\n           # Exit (to not set power params in MAAS) if no IPMI_IP_ADDRESS\n           # has been detected\n           exit(1)\n   \n       if bmc_supports_lan2_0():\n           IPMI_VERSION = "LAN_2_0"\n       else:\n           IPMI_VERSION = "LAN"\n       if args.commission_creds:\n           print(get_maas_power_settings_json(\n               IPMI_MAAS_USER, IPMI_MAAS_PASSWORD, IPMI_IP_ADDRESS, IPMI_VERSION))\n       else:\n           print(get_maas_power_settings(\n               IPMI_MAAS_USER, IPMI_MAAS_PASSWORD, IPMI_IP_ADDRESS, IPMI_VERSION))\n   \n   if __name__ == \'__main__\':\n       main()\n   END_MAAS_IPMI_AUTODETECT\n\n   add_bin "maas-moonshot-autodetect" <<"END_MAAS_MOONSHOT_AUTODETECT"\n   #!/usr/bin/python3\n   \n   import argparse\n   import json\n   import re\n   import subprocess\n   \n   \n   IPMI_MAAS_USER = \'Administrator\'\n   IPMI_MAAS_PASSWORD = \'password\'\n   \n   \n   def get_local_address():\n       output = subprocess.getoutput(\'ipmitool raw 0x2c 1 0\')\n       return "0x%s" % output.split()[2]\n   \n   \n   def get_cartridge_address(local_address):\n       # obtain address of Cartridge Controller (parent of the system node):\n       output = subprocess.getoutput(\n           \'ipmitool -t 0x20 -b 0 -m %s raw 0x2c 1 0\' % local_address)\n       return "0x%s" % output.split()[2]\n   \n   \n   def get_channel_number(address, output):\n       # channel number (routing to this system node)\n       show = re.compile(\n           r\'Device Slave Address\\s+:\\s+%sh(.*?)Channel Number\\s+:\\s+\\d+\'\n           % address.replace(\'0x\', \'\').upper(),\n           re.DOTALL)\n       res = show.search(output)\n       return res.group(0).split()[-1]\n   \n   \n   def get_ipmi_ip_address(local_address):\n       output = subprocess.getoutput(\n           \'ipmitool -B 0 -T 0x20 -b 0 -t 0x20 -m %s lan print 2\' % local_address)\n       show_re = re.compile(\'IP Address\\s+:\\s+([0-9]{1,3}[.]?){4}\')\n       res = show_re.search(output)\n       return res.group().split()[-1]\n   \n   \n   def get_maas_power_settings(user, password, ipaddress, hwaddress):\n       return "%s,%s,%s,%s" % (user, password, ipaddress, hwaddress)\n   \n   \n   def get_maas_power_settings_json(user, password, ipaddress, hwaddress):\n       power_params = {\n           "power_address": ipaddress,\n           "power_pass": password,\n           "power_user": user,\n           "power_hwaddress": hwaddress,\n       }\n       return json.dumps(power_params)\n   \n   \n   def main():\n       parser = argparse.ArgumentParser(\n           description=\'send config file to modify IPMI settings with\')\n       parser.add_argument(\n           "--commission-creds", action="store_true", dest="commission_creds",\n           help="Create IPMI temporary credentials", default=False)\n   \n       args = parser.parse_args()\n   \n       local_address = get_local_address()\n       node_address = get_cartridge_address(local_address)\n   \n       # Obtaining channel numbers:\n       output = subprocess.getoutput(\n           \'ipmitool -b 0 -t 0x20 -m %s sdr list mcloc -v\' % local_address)\n   \n       local_chan = get_channel_number(local_address, output)\n       cartridge_chan = get_channel_number(node_address, output)\n   \n       # ipmitool -I lanplus -H 10.16.1.11 -U Administrator -P password -B 0\n       #     -T 0x88 -b 7 -t 0x72 -m 0x20 power status\n       IPMI_HW_ADDRESS = "-B %s -T %s -b %s -t %s -m 0x20" % (\n           cartridge_chan,\n           node_address,\n           local_chan,\n           local_address,\n           )\n   \n       IPMI_IP_ADDRESS = get_ipmi_ip_address(local_address)\n   \n       if args.commission_creds:\n           print(get_maas_power_settings_json(\n               IPMI_MAAS_USER, IPMI_MAAS_PASSWORD, IPMI_IP_ADDRESS,\n               IPMI_HW_ADDRESS))\n       else:\n           print(get_maas_power_settings(\n               IPMI_MAAS_USER, IPMI_MAAS_PASSWORD, IPMI_IP_ADDRESS,\n               IPMI_HW_ADDRESS))\n   \n   \n   if __name__ == \'__main__\':\n       main()\n   END_MAAS_MOONSHOT_AUTODETECT\n\n   add_bin "maas-enlist" <<"END_MAAS_ENLIST"\n   #!/bin/sh\n   #\n   #    maas-enlist: MAAS Enlistment Tool\n   #\n   #    Copyright (C) 2014-2016 Canonical Ltd.\n   #\n   #    Authors: Andres Rodriguez <andres.rodriguez@xxxxxxxxxxxxx>\n   #\n   #    This program is free software: you can redistribute it and/or modify\n   #    it under the terms of the GNU General Public License as published by\n   #    the Free Software Foundation, version 3 of the License.\n   #\n   #    This program is distributed in the hope that it will be useful,\n   #    but WITHOUT ANY WARRANTY; without even the implied warranty of\n   #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n   #    GNU General Public License for more details.\n   #\n   #    You should have received a copy of the GNU General Public License\n   #    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n   \n   get_mac_addresses() {\n   \tlocal macs\n   \tlocal pxe_mac\n   \tlocal mac_addresses\n   \tmacs=`ip addr | egrep \'link/ether\' | cut -d\' \' -f6`\n   \t# Obtain the BOOTIF MAC address from the kernel command line.\n   \t# Note that BOOTIF stores the MAC in the format of\n   \t# \'01-AA-BB-CC-DD-EE-FF", or "01-AA:BB:CC:DD:EE:FF",\n           # and we remove the \'01-\'.\n   \tpxe_mac=`cat /proc/cmdline | egrep \'BOOTIF=\' | sed -e \'s/.*[[:space:]]BOOTIF=\\([-:0-9A-Fa-f]\\+\\).*/\\1/g\' -e \'s,^01-,,g\' -e \'s,-,:,g\'`\n   \t# Initialize the mac_address variable with "$pxe_mac",\n   \t# otherwise "$pxe_mac" will be empty.\n   \tmac_addresses="$pxe_mac"\n   \n   \tfor mac in $macs;\n   \tdo\n   \t\t# We only add more mac\'s if "$mac" is different\n   \t\t# from "$pxe_mac"\n   \t\tif [ "$mac" != "$pxe_mac" ]; then\n   \t\t\tif [ -z "$mac_addresses" ]; then\n   \t\t\t\tmac_addresses="$mac"\n   \t\t\telse\n   \t\t\t\tmac_addresses="$mac_addresses,$mac"\n   \t\t\tfi\n   \t\tfi\n   \tdone\n   \techo "$mac_addresses"\n   }\n   \n   get_mac_address_by_interface() {\n   \tiface="$1"\n   \tmac=`ip addr sh "$iface" | egrep -m1 \'link/ether\' | cut -d\' \' -f6`\n   \techo "$mac"\n   }\n   \n   get_mac_address_curl_parms() {\n   \tlocal args="" input_string="$1"\n   \tOIFS=$IFS; IFS=","; set -- $input_string; IFS=$OIFS\n   \tfor i in "$@";\n   \tdo\n   \t\targs="${args} --data-urlencode mac_addresses=${i}"\n   \t\t#mac_address="$mac_address""&mac_addresses=""${i}";\n   \tdone\n   \techo "${args# }"\n   }\n   \n   get_host_architecture() {\n   \tif grep "flags" /proc/cpuinfo | grep -qs "\\ lm\\ "; then\n   \t\t# if /proc/cpuinfo Flags has \'lm\', it is x86_64\n   \t\tarch="amd64"\n   \telse\n   \t\tarch=`archdetect | cut -d\'/\' -f1`\n   \tfi\n   \techo "$arch"\n   }\n   \n   get_host_subarchitecture() {\n   \tlocal arch=$1\n   \tcase $arch in\n   \t    i386|amd64|arm64|ppc64el)\n   \t\t# Skip the call to archdetect as that\'s what\n   \t\t# get_host_architecture does\n   \t\techo generic\n   \t\t;;\n   \t    *)\n   \t\tarchdetect | cut -d\'/\' -f2\n   \t\t;;\n   \tesac\n   }\n   \n   get_server_name() {\n   \tlocal servername="$1";\n   \t_RET=${servername#*://};\n   \t_RET=${_RET%%/*};\n   \techo "$_RET";\n   }\n   \n   enlist_node() {\n   \tserverurl="${1}"\n   \tmac="${2}"\n   \tarch="${3}"\n   \tsubarch="${4}"\n   \thostname="${5}"\n   \tpower_type="${6}"\n   \tpower_params="${7}"\n   \n   \tlocal macparms=""\n   \tmacparms=$(get_mac_address_curl_parms "$mac")\n   \n   \tcurl \\\n   \t    --fail \\\n   \t    --header "Accept: application/json" \\\n   \t    --data-urlencode "hostname=${hostname}" \\\n   \t    --data-urlencode "architecture=${arch}" \\\n   \t    --data-urlencode "subarchitecture=${subarch}" \\\n   \t    --data-urlencode "power_type=${power_type}" \\\n   \t    --data-urlencode "power_parameters=${power_params}" \\\n   \t    ${macparms} \\\n   \t    "${serverurl}"\n   \n   }\n   \n   Error () {\n   \techo "ERROR: $1"\n   \texit 1\n   }\n   \n   Usage() {\n   \tcat <<EOF\n   Usage: ${0##*/} [ options ]\n   \n      node enlistment into the MAAS server\n   \n      options:\n         -s | --serverurl        resolvable MAAS server API URL (maas.local if not specified)\n         -n | --hostname         hostname of the node to register\n         -i | --interface        interface address to register (obtains MAC address)\n         -a | --arch             architecture of the node to register\n         -t | --power-type       power type (ipmi, virsh, manual)\n         -p | --power-params     power parameters (In JSON format, between single quotes)\n                                 e.g. --power-params \'{"power_address":"192.168.1.10"}\'\n         --subarch               subarchitecture of the node to register\n   \n      Example:\n       - ${0##*/} --serverurl 127.0.0.1 --interface eth0\n   \n   EOF\n   }\n   \n   bad_Usage() { Usage 1>&2; [ $# -eq 0 ] || Error "$@"; exit 1; }\n   \n   short_opts="hs:n:i:a:t:p:"\n   long_opts="help,serverurl:,hostname:,interface:,arch:,subarch:,power-type:,power-params:"\n   getopt_out=$(getopt --name "${0##*/}" \\\n   \t--options "${short_opts}" --long "${long_opts}" -- "$@") &&\n   \teval set -- "${getopt_out}" ||\n   \tbad_Usage\n   \n   while [ $# -ne 0 ]; do\n   \tcur=${1}; next=${2};\n   \tcase "$cur" in\n   \t\t-h|--help) Usage ; exit 0;;\n   \t\t-s|--serverurl) serverurl=${2}; shift;;\n   \t\t-n|--hostname) hostname=${2}; shift;;\n   \t\t-i|--interface) iface=${2}; shift;;\n   \t\t-a|--arch) arch=${2}; shift;;\n   \t\t--subarch) subarch=${2}; shift;;\n   \t\t-t|--power-type) power_type=${2}; shift;;\n   \t\t-p|--power-params) power_parameters=${2}; shift;;\n   \t\t--) shift; break;;\n   \tesac\n   \tshift;\n   done\n   \n   ## check arguments here\n   #[ $# -eq 0 ] && bad_Usage\n   \n   # If no interface is specified. obtain the MAC from all interfaces\n   if [ -z "$iface" ]; then\n   \tmac_addrs=$(get_mac_addresses)\n   else\n   \tmac_addrs=$(get_mac_address_by_interface "$iface")\n   fi\n   \n   protocol=\n   servername=$(get_server_name "$serverurl")\n   if echo "$serverurl" | egrep -q \'^[a-z]+://\' ; then\n   \tprotocol=`echo "$serverurl" | sed \'s#^\\([a-z]\\+\\)://.*#\\\\1#\'`\n   else\n   \tprotocol="http"\n   fi\n   \n   if [ "$protocol" != "http" ] && [ "$protocol" != "https" ]; then\n   \tError "Invalid protocol \'$protocol\'"\n   fi\n   \n   if [ -z "$servername" ]; then\n   \tserverurl="maas.local"\n   \tservername="$serverurl"\n   fi\n   if echo "$serverurl" | egrep -q \'(^[a-z]+://|^)[a-z0-9\\.\\-]+($|/$)\'; then\n   \tapi_url="MAAS/api/2.0/machines/"\n   else\n   \tapi_url=`echo $serverurl | sed \'s#^\\(\\|[a-z]\\+://\\)[a-zA-Z0-9\\.\\-]\\+\\(\\|\\:[0-9]\\+\\)/##\'`\n   fi\n   \n   #TODO: Auto-detect hostname?\n   if [ -z "$hostname" ]; then\n   \tcontinue\n   \t#Error "No hostname has been provided"\n   fi\n   \n   if [ -z "$arch" ]; then\n   \tarch=$(get_host_architecture)\n   fi\n   \n   if [ -z "$subarch" ]; then\n   \tsubarch=$(get_host_subarchitecture $arch)\n   fi\n   \n   if [ -n "$power_type" ]; then\n   \tcase $power_type in\n   \t\tipmi) continue ;;\n   \t\tvirsh) continue ;;\n   \t\tmoonshot) continue ;;\n   \t\t*) Error "Invalid power type: [$power_type]"\n   \tesac\n   fi\n   \n   enlist_node "$protocol://$servername/$api_url" "${mac_addrs}" "$arch" "$subarch" "$hostname" "$power_type" "$power_parameters"\n   END_MAAS_ENLIST\n\n   # we could obtain the interface that booted from the kernel cmdline\n   # thanks to \'IPAPPEND\' (http://www.syslinux.org/wiki/index.php/SYSLINUX)\n   url="http://10.245.136.6/MAAS/api/2.0/machines/"\n   # load ipmi modules\n   load_modules\n   pargs=""\n   if $IPMI_CHANGE_STATIC_TO_DHCP; then\n      pargs="--dhcp-if-static"\n   fi\n   set -x\n   power_type=$(maas-ipmi-autodetect-tool)\n   case "$power_type" in\n       ipmi)\n           power_params=$(maas-ipmi-autodetect --configdir "$IPMI_CONFIG_D" ${pargs} --commission-creds) &&\n             [ -n "${power_params}" ] && power_params=${power_params%.}\n           ;;\n       moonshot)\n           power_params=$(maas-moonshot-autodetect --commission-creds) &&\n             [ -n "${power_params}" ] && power_params=${power_params%.}\n           ;;\n   esac\n   # Try maas-enlist without power parameters on failure for older versions of\n   # maas-enlist without power parameter support\n   maas-enlist --serverurl "$url" ${power_params:+--power-params "${power_params}" --power-type "${power_type}"}>/tmp/enlist.out ||\\\n      maas-enlist --serverurl "$url" >/tmp/enlist.out\n   if [ $? -eq 0 ]; then\n      msg="successfully enlisted to \'$url\'"\n      echo\n      echo "=== $(date -R): $msg"\n      cat  /tmp/enlist.out\n      echo =============================================\n      sleep 10\n   else\n      user="ubuntu"\n      pass="ubuntu"\n\n      echo "$user:$pass" | chpasswd\n      bfile="/tmp/block-poweroff"\n      { echo "#!/bin/sh"; echo "touch $bfile"; } > /etc/profile.d/A01-block.sh\n      chmod 755 /etc/profile.d/A01-block.sh\n      echo\n      echo =============================================\n      echo "failed to enlist system maas server"\n      echo "sleeping 60 seconds then poweroff"\n      echo\n      echo "login with \'$user:$pass\' to debug and disable poweroff"\n      echo\n      cat /tmp/enlist.out\n      echo =============================================\n      sleep 60\n      [ -e $bfile ] && exit 0\n   fi\n\n\n\npackages: [ freeipmi-tools, openipmi, ipmitool, archdetect-deb ]\noutput: {all: \'| tee -a /var/log/cloud-init-output.log\'}\nruncmd:\n - [ sh, -c, *maas_enlist ]\n'


----------------------------------------------------------------------
XML: /tmp/autopkgtest.llqXNB/maas-package-test-artifacts/nosetests.xml
----------------------------------------------------------------------
Ran 10 tests in 106.143s

FAILED (SKIP=3, failures=1)
adt-run: DBG: testbed command exited with code 1
adt-run [07:01:54]: test maas-package-test: -----------------------]
adt-run: DBG: testbed executing test finished with exit status 1
adt-run: DBG: sending command to testbed: copyup /tmp/autopkgtest.llqXNB/maas-package-test-stdout /var/lib/jenkins/workspace/api_tests/results/maas-package-test-stdout
adt-virt-qemu: DBG: executing copyup /tmp/autopkgtest.llqXNB/maas-package-test-stdout /var/lib/jenkins/workspace/api_tests/results/maas-package-test-stdout
adt-virt-qemu: DBG: ['cmdls', "(['/tmp/adt-virt-qemu.3v4s_6iv/runcmd', 'sh', '-ec', 'cat </tmp/autopkgtest.llqXNB/maas-package-test-stdout'], ['cat'])"]
adt-virt-qemu: DBG: ['srcstdin', "<_io.TextIOWrapper name='/dev/null' mode='r' encoding='ANSI_X3.4-1968'>", 'deststdout', "<_io.TextIOWrapper name='/var/lib/jenkins/workspace/api_tests/results/maas-package-test-stdout' mode='w' encoding='ANSI_X3.4-1968'>", 'devnull_read', <_io.TextIOWrapper name='/dev/null' mode='r' encoding='ANSI_X3.4-1968'>]
adt-virt-qemu: DBG:  +< /tmp/adt-virt-qemu.3v4s_6iv/runcmd sh -ec cat </tmp/autopkgtest.llqXNB/maas-package-test-stdout
adt-virt-qemu: DBG:  +> cat
adt-virt-qemu: DBG:  +>?
adt-virt-qemu: DBG:  +<?
adt-run: DBG: got reply from testbed: ok
adt-run: DBG: sending command to testbed: copyup /tmp/autopkgtest.llqXNB/maas-package-test-stderr /var/lib/jenkins/workspace/api_tests/results/maas-package-test-stderr
adt-virt-qemu: DBG: executing copyup /tmp/autopkgtest.llqXNB/maas-package-test-stderr /var/lib/jenkins/workspace/api_tests/results/maas-package-test-stderr
adt-virt-qemu: DBG: ['cmdls', "(['/tmp/adt-virt-qemu.3v4s_6iv/runcmd', 'sh', '-ec', 'cat </tmp/autopkgtest.llqXNB/maas-package-test-stderr'], ['cat'])"]
adt-virt-qemu: DBG: ['srcstdin', "<_io.TextIOWrapper name='/dev/null' mode='r' encoding='ANSI_X3.4-1968'>", 'deststdout', "<_io.TextIOWrapper name='/var/lib/jenkins/workspace/api_tests/results/maas-package-test-stderr' mode='w' encoding='ANSI_X3.4-1968'>", 'devnull_read', <_io.TextIOWrapper name='/dev/null' mode='r' encoding='ANSI_X3.4-1968'>]
adt-virt-qemu: DBG:  +< /tmp/adt-virt-qemu.3v4s_6iv/runcmd sh -ec cat </tmp/autopkgtest.llqXNB/maas-package-test-stderr
adt-virt-qemu: DBG:  +> cat
adt-virt-qemu: DBG:  +>?
adt-virt-qemu: DBG:  +<?
adt-run: DBG: got reply from testbed: ok
adt-run [07:01:55]: test maas-package-test:  - - - - - - - - - - results - - - - - - - - - -
maas-package-test    FAIL non-zero exit status 1
adt-run: DBG: sending command to testbed: copyup /tmp/autopkgtest.llqXNB/maas-package-test-artifacts/ /var/lib/jenkins/workspace/api_tests/results/artifacts/
adt-virt-qemu: DBG: executing copyup /tmp/autopkgtest.llqXNB/maas-package-test-artifacts/ /var/lib/jenkins/workspace/api_tests/results/artifacts/
adt-virt-qemu: DBG: ['cmdls', "(['/tmp/adt-virt-qemu.3v4s_6iv/runcmd', 'sh', '-ec', 'cd /tmp/autopkgtest.llqXNB/maas-package-test-artifacts/; tar --warning=none -c . -f -'], ['tar', '--directory', '/var/lib/jenkins/workspace/api_tests/results/artifacts/', '--warning=none', '--preserve-permissions', '--extract', '--no-same-owner', '-f', '-'])"]
adt-virt-qemu: DBG: ['srcstdin', "<_io.TextIOWrapper name='/dev/null' mode='r' encoding='ANSI_X3.4-1968'>", 'deststdout', "<_io.TextIOWrapper name='/dev/null' mode='r' encoding='ANSI_X3.4-1968'>", 'devnull_read', <_io.TextIOWrapper name='/dev/null' mode='r' encoding='ANSI_X3.4-1968'>]
adt-virt-qemu: DBG:  +< /tmp/adt-virt-qemu.3v4s_6iv/runcmd sh -ec cd /tmp/autopkgtest.llqXNB/maas-package-test-artifacts/; tar --warning=none -c . -f -
adt-virt-qemu: DBG:  +> tar --directory /var/lib/jenkins/workspace/api_tests/results/artifacts/ --warning=none --preserve-permissions --extract --no-same-owner -f -
adt-virt-qemu: DBG:  +>?
adt-virt-qemu: DBG:  +<?
adt-run: DBG: got reply from testbed: ok
adt-run: DBG: testbed command ['rm', '-rf', '/tmp/autopkgtest.llqXNB/maas-package-test-artifacts', '/tmp/autopkgtest.llqXNB/adttmp'], kind short, sout raw, serr pipe, env []
adt-run: DBG: testbed command exited with code 0
adt-run: DBG: no need to restore click AppArmor profiles
adt-run: DBG: needs_reset, previously=False, requested by run_tests() line 161
adt-run [07:01:56]: @@@@@@@@@@@@@@@@@@@@ summary
maas-package-test    FAIL non-zero exit status 1
adt-run: DBG: testbed stop
adt-run: DBG: testbed close, scratch=/tmp/autopkgtest.llqXNB
adt-run: DBG: sending command to testbed: close
adt-virt-qemu: DBG: executing close
adt-virt-qemu: DBG: cleanup...
qemu: terminating on signal 15 from pid 10393
adt-run: DBG: got reply from testbed: ok
adt-run: DBG: sending command to testbed: quit
adt-virt-qemu: DBG: executing quit
adt-virt-qemu: DBG: cleanup...
Build step 'Execute shell' marked build as failure
Archiving artifacts
Recording test results
[BFA] Scanning build for known causes...
[BFA] No failure causes found
[BFA] Done. 0s
Email was triggered for: Failure - Any
Sending email for trigger: Failure - Any