a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen# -*- coding: utf-8 -*-
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen# CDDL HEADER START
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen# The contents of this file are subject to the terms of the
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen# Common Development and Distribution License (the "License").
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen# You may not use this file except in compliance with the License.
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen# See the License for the specific language governing permissions
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen# and limitations under the License.
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen# When distributing Covered Code, include this CDDL HEADER in each
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen# If applicable, add the following below this CDDL HEADER, with the
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen# fields enclosed by brackets "[]" replaced with your own identifying
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen# information: Portions Copyright [yyyy] [name of copyright owner]
efd203f312659a7ce82644fb2a39d791ac198b77Teemu Huovila# CDDL HEADER END
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen# Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainenclass TestPkgInitInstall(pkg5unittest.SingleDepotTestCase):
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen open core-os@1.0
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add set name=pkg.fmri value=pkg://solaris/system/core-os@1.0
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add set name=pkg.summary value="Core Solaris"
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add set name=pkg.description value="Operating system core utilities, daemons, and configuration files."
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add dir path=etc group=sys owner=root mode=0555
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add dir path=etc/ftpd group=sys owner=root mode=0555
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add file path=etc/ftpd/ftpusers group=sys preserve=true owner=root mode=0444
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add link path=etc/ftpusers target=./ftpd/ftpusers
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add file path=etc/group group=sys preserve=true owner=root mode=0444
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add file path=etc/passwd group=sys preserve=true owner=root mode=0444
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add file path=etc/shadow group=sys mode=0400 preserve=true owner=root
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add group groupname=adm gid=4
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add group groupname=bin gid=2
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add group groupname=daemon gid=12
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add group groupname=dialout gid=13
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add group groupname=games gid=20
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add group groupname=lp gid=8
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add group groupname=mail gid=6
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add group groupname=noaccess gid=60002
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add group groupname=nobody gid=60001
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add group groupname=nogroup gid=65534
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add group groupname=other gid=1
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add group groupname=root gid=0
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add group groupname=staff gid=10
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add group groupname=sys gid=3
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add group groupname=sysadmin gid=14
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add group groupname=tty gid=7
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add group groupname=webservd gid=80
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add user username=adm ftpuser=false gcos-field=Admin group=adm home-dir=/var/adm lastchg=6445 login-shell=/bin/sh password=NP uid=4 group-list=lp group-list=sys group-list=tty
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add user username=bin ftpuser=false gcos-field="" group=bin group-list=sys home-dir=/ lastchg=6445 login-shell=/bin/sh password=NP uid=2
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen add user username=daemon ftpuser=false gcos-field="" group=other home-dir=/ lastchg=6445 login-shell=/bin/sh password=NP uid=1 group-list=adm group-list=bin
d31a407872fb93f907fc2587daaa780ffa9a6f56Martti Rannanjärvi add user username=noaccess ftpuser=false gcos-field="No Access User" group=nogroup home-dir=/ lastchg=6445 login-shell=/bin/sh password=*LK* uid=60002
d31a407872fb93f907fc2587daaa780ffa9a6f56Martti Rannanjärvi add user username=nobody ftpuser=false gcos-field="NFS Anonymous Access User" group=nobody home-dir=/ login-shell=/bin/sh uid=60001
d31a407872fb93f907fc2587daaa780ffa9a6f56Martti Rannanjärvi add user username=nobody4 ftpuser=false gcos-field="SunOS 4.x NFS Anonymous Access User" group=nogroup home-dir=/ lastchg=6445 login-shell=/bin/sh password=*LK* uid=65534
d31a407872fb93f907fc2587daaa780ffa9a6f56Martti Rannanjärvi add user username=root ftpuser=false gcos-field=Super-User group=root home-dir=/root lastchg=6445 login-shell=/usr/bin/bash password="" uid=0 group-list=adm group-list=bin group-list=daemon group-list=lp group-list=mail group-list=other group-list=sys group-list=tty
d31a407872fb93f907fc2587daaa780ffa9a6f56Martti Rannanjärvi add user username=sys ftpuser=false gcos-field="" group=sys home-dir=/ lastchg=6445 login-shell=/bin/sh password=NP uid=3
d31a407872fb93f907fc2587daaa780ffa9a6f56Martti Rannanjärvi add user username=webservd ftpuser=false gcos-field="WebServer Reserved UID" group=webservd home-dir=/ login-shell=/bin/sh password=*LK* uid=80
d31a407872fb93f907fc2587daaa780ffa9a6f56Martti Rannanjärvi misc_files = { "etc/passwd":"", "etc/group":"", "etc/shadow":"", "etc/ftpd/ftpusers":"" }
d31a407872fb93f907fc2587daaa780ffa9a6f56Martti Rannanjärvi pkg5unittest.SingleDepotTestCase.setUp(self)
d31a407872fb93f907fc2587daaa780ffa9a6f56Martti Rannanjärvi return open(os.path.join(self.get_img_path(), path))
efd203f312659a7ce82644fb2a39d791ac198b77Teemu Huovila # make sure the ':' separated file is sorted in ascending order
efd203f312659a7ce82644fb2a39d791ac198b77Teemu Huovila # on the integer in the specified column
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen """test initial install of stripped down core OS"""
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen plist = self.pkgsend_bulk(self.rurl, self.core)
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen # verify that /etc/passwd and /etc/group are in
a49d1c2ca3c134c0c62b37a94936c78e9849e044Timo Sirainen # ascending [UG]ID order